github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- 
clang/include/clang/Parse/Parser.h clang/include/clang/Sema/Scope.h 
clang/include/clang/Sema/Sema.h clang/lib/Interpreter/IncrementalParser.cpp 
clang/lib/Parse/ParseCXXInlineMethods.cpp clang/lib/Parse/ParseDecl.cpp 
clang/lib/Parse/ParseDeclCXX.cpp clang/lib/Parse/ParseExpr.cpp 
clang/lib/Parse/ParseExprCXX.cpp clang/lib/Parse/ParseHLSL.cpp 
clang/lib/Parse/ParseObjc.cpp clang/lib/Parse/ParseOpenACC.cpp 
clang/lib/Parse/ParseOpenMP.cpp clang/lib/Parse/ParsePragma.cpp 
clang/lib/Parse/ParseStmt.cpp clang/lib/Parse/ParseTemplate.cpp 
clang/lib/Parse/Parser.cpp clang/lib/Sema/Scope.cpp clang/lib/Sema/Sema.cpp 
clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaStmt.cpp 
--diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index ecf1cba8c..e997dd300 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -4826,7 +4826,7 @@ void Parser::ParseStructUnionBody(SourceLocation 
RecordLoc,
   if (T.consumeOpen())
     return;
 
-  ParseScope StructScope(Actions, Scope::ClassScope|Scope::DeclScope);
+  ParseScope StructScope(Actions, Scope::ClassScope | Scope::DeclScope);
   Actions.ActOnTagStartDefinition(getCurScope(), TagDecl);
 
   // `LateAttrParseExperimentalExtOnly=true` requests that only attributes
diff --git a/clang/lib/Sema/Scope.cpp b/clang/lib/Sema/Scope.cpp
index 79938b5db..cc712489e 100644
--- a/clang/lib/Sema/Scope.cpp
+++ b/clang/lib/Sema/Scope.cpp
@@ -12,8 +12,8 @@
 
//===----------------------------------------------------------------------===//
 
 #include "clang/Sema/Scope.h"
-#include "clang/Sema/Sema.h"
 #include "clang/AST/Decl.h"
+#include "clang/Sema/Sema.h"
 #include "llvm/Support/raw_ostream.h"
 
 using namespace clang;
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index efd33fd39..153bf071e 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -2987,7 +2987,7 @@ void Sema::ExitScope() {
 
 void Sema::FreeScopes() {
   // Take care not to delete 'CurScope' twice.
-  auto IsCurScope = [&](auto& S) { return S.get() == CurScope; };
+  auto IsCurScope = [&](auto &S) { return S.get() == CurScope; };
   if (llvm::find_if(ScopeCache, IsCurScope) == ScopeCache.end())
     delete CurScope;
 
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index da1005f8a..f5b388868 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -2738,12 +2738,10 @@ Sema::ForRangeBeginEndInfo 
Sema::BuildCXXForRangeBeginEndVars(
   // Build auto __begin = begin-expr, __end = end-expr.
   // Divide by 2, since the variables are in the inner scope (loop body).
   const auto DepthStr = std::to_string(S->getDepth() / 2);
-  VarDecl *BeginVar =
-      BuildForRangeVarDecl(*this, ColonLoc, AutoType,
-                           std::string("__begin") + DepthStr, Constexpr);
-  VarDecl *EndVar =
-      BuildForRangeVarDecl(*this, ColonLoc, AutoType,
-                           std::string("__end") + DepthStr, Constexpr);
+  VarDecl *BeginVar = BuildForRangeVarDecl(
+      *this, ColonLoc, AutoType, std::string("__begin") + DepthStr, Constexpr);
+  VarDecl *EndVar = BuildForRangeVarDecl(
+      *this, ColonLoc, AutoType, std::string("__end") + DepthStr, Constexpr);
 
   // Build begin-expr and end-expr and attach to __begin and __end variables.
   ExprResult BeginExpr, EndExpr;

``````````

</details>


https://github.com/llvm/llvm-project/pull/169683
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to