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,h -- 
clang/include/clang/Format/Format.h clang/lib/Format/Format.cpp 
clang/lib/Format/UnwrappedLineFormatter.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/include/clang/Format/Format.h 
b/clang/include/clang/Format/Format.h
index b60ad0adc..450949e4a 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -3067,7 +3067,7 @@ struct FormatStyle {
   /// IndentExternBlockStyle is the type of indenting of extern blocks.
   /// \version 11
   IndentExternBlockStyle IndentExternBlock;
-  
+
   /// Indent goto labels.
   ///
   /// When ``false``, goto labels are flushed left.
@@ -3084,7 +3084,7 @@ struct FormatStyle {
   /// \endcode
   /// \version 10
   bool IndentGotoLabels;
-  
+
   /// If true, aligns labels according to the current indentation level
   /// instead of flushing them to the left margin.
   ///
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 497c364f2..cdf88f55a 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1204,7 +1204,8 @@ template <> struct MappingTraits<FormatStyle> {
     IO.mapOptional("IndentExportBlock", Style.IndentExportBlock);
     IO.mapOptional("IndentExternBlock", Style.IndentExternBlock);
     IO.mapOptional("IndentGotoLabels", Style.IndentGotoLabels);
-    IO.mapOptional("IndentGotoLabelsToCurrentScope", 
Style.IndentGotoLabelsToCurrentScope);
+    IO.mapOptional("IndentGotoLabelsToCurrentScope",
+                   Style.IndentGotoLabelsToCurrentScope);
     IO.mapOptional("IndentPPDirectives", Style.IndentPPDirectives);
     IO.mapOptional("IndentRequiresClause", Style.IndentRequiresClause);
     IO.mapOptional("IndentWidth", Style.IndentWidth);
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp 
b/clang/lib/Format/UnwrappedLineFormatter.cpp
index aa422926c..e22782975 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -133,14 +133,14 @@ private:
                                          : Style.AccessModifierOffset;
     }
 
-    if(Line.First->is(tok::identifier) && Line.First->Next && 
Line.First->Next->is(TT_GotoLabelColon)){
-      if(Style.IndentGotoLabelsToCurrentScope){
+    if (Line.First->is(tok::identifier) && Line.First->Next &&
+        Line.First->Next->is(TT_GotoLabelColon)) {
+      if (Style.IndentGotoLabelsToCurrentScope)
         return Style.IndentWidth;
-      }
     }
     return 0;
   }
-  
+
   /// Get the indent of \p Level from \p IndentForLevel.
   ///
   /// \p IndentForLevel must contain the indent for the level \c l

``````````

</details>


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

Reply via email to