[clang] [clang-format] modified goto bool to enum (PR #65140)

Devansh Varshney देवांश वार्ष्णेय via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 4 12:22:32 PDT 2023


================
@@ -2432,9 +2431,25 @@ struct FormatStyle {
   ///    label2:                                label2:
   ///      return 1;                              return 1;
   ///    }                                      }
+  ///
+  ///    GLI_HalfIndent:
+  ///    int f() {
+  ///      if (foo()) {
+  ///      label1:
+  ///        bar();
+  ///      }
+  ///    label2:
+  ///      return 1;
+  ///    }
   /// \endcode
   /// \version 10
-  bool IndentGotoLabels;
+  enum GotoLabelIndentation {
+    GLI_None,   // Do not indent goto labels.
+    GLI_Indent, // Indent goto labels at the same level as the surrounding code.
+    GLI_HalfIndent, // Indent goto labels at a half indent level.
----------------
varshneydevansh wrote:

`3047 |   Style.IndentGotoLabels = false;` in `llvm-project/clang/unittests/Format/FormatTest.cpp`

I missed this and it's shameful correcting it 

https://github.com/llvm/llvm-project/pull/65140


More information about the cfe-commits mailing list