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 cpp -- 
clang/lib/Sema/AnalysisBasedWarnings.cpp clang/lib/Sema/SemaStmt.cpp 
clang/test/SemaCXX/warn-loop-analysis.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/Sema/AnalysisBasedWarnings.cpp 
b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index 0066bd853..fa66248bf 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -3034,14 +3034,14 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
     AC.getCFGBuildOptions().setAllAlwaysAdd();
   } else {
     AC.getCFGBuildOptions()
-      .setAlwaysAdd(Stmt::BinaryOperatorClass)
-      .setAlwaysAdd(Stmt::CompoundAssignOperatorClass)
-      .setAlwaysAdd(Stmt::BlockExprClass)
-      .setAlwaysAdd(Stmt::CStyleCastExprClass)
-      .setAlwaysAdd(Stmt::DeclRefExprClass)
-      .setAlwaysAdd(Stmt::ImplicitCastExprClass)
-      .setAlwaysAdd(Stmt::UnaryOperatorClass)
-      .setAlwaysAdd(Stmt::ForStmtClass);
+        .setAlwaysAdd(Stmt::BinaryOperatorClass)
+        .setAlwaysAdd(Stmt::CompoundAssignOperatorClass)
+        .setAlwaysAdd(Stmt::BlockExprClass)
+        .setAlwaysAdd(Stmt::CStyleCastExprClass)
+        .setAlwaysAdd(Stmt::DeclRefExprClass)
+        .setAlwaysAdd(Stmt::ImplicitCastExprClass)
+        .setAlwaysAdd(Stmt::UnaryOperatorClass)
+        .setAlwaysAdd(Stmt::ForStmtClass);
   }
   if (EnableLifetimeSafetyAnalysis) {
     AC.getCFGBuildOptions().AddLifetime = true;
@@ -3181,7 +3181,8 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
       if (S.getLangOpts().CPlusPlus && !fscope->isCoroutine() && 
isNoexcept(FD))
         checkThrowInNonThrowingFunc(S, FD, AC);
 
-  if (!Diags.isIgnored(diag::warn_variables_not_in_loop_body, 
D->getBeginLoc())) {
+  if (!Diags.isIgnored(diag::warn_variables_not_in_loop_body,
+                       D->getBeginLoc())) {
     D->dumpColor();
     DiagnoseForLoopConditionVarsNotModified();
   }
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 736df4001..695e10060 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -2321,9 +2321,10 @@ StmtResult Sema::ActOnForStmt(SourceLocation ForLoc, 
SourceLocation LParenLoc,
   CheckBreakContinueBinding(third.get());
   CheckForRedundantIteration(*this, third.get(), Body);
 
-//  if (!Second.get().first)
-//    CheckForLoopConditionalStatement(*this, Second.get().second, third.get(),
-//                                     Body);
+  //  if (!Second.get().first)
+  //    CheckForLoopConditionalStatement(*this, Second.get().second,
+  //    third.get(),
+  //                                     Body);
 
   if (Second.get().second &&
       !Diags.isIgnored(diag::warn_comma_operator,

``````````

</details>


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

Reply via email to