[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 6 15:33:26 PDT 2024


================
@@ -305,37 +305,43 @@ TEST(ConfigParseTest, ParsesConfiguration) {
         FormatStyle::AlignConsecutiveStyle(                                    \
             {/*Enabled=*/false, /*AcrossEmptyLines=*/false,                    \
              /*AcrossComments=*/false, /*AlignCompound=*/false,                \
+             /*AlignFunctionDeclarations=*/true,                               \
              /*AlignFunctionPointers=*/false, /*PadOperators=*/true}));        \
     CHECK_PARSE(                                                               \
         #FIELD ": Consecutive", FIELD,                                         \
         FormatStyle::AlignConsecutiveStyle(                                    \
             {/*Enabled=*/true, /*AcrossEmptyLines=*/false,                     \
              /*AcrossComments=*/false, /*AlignCompound=*/false,                \
+             /*AlignFunctionDeclarations=*/true,                               \
              /*AlignFunctionPointers=*/false, /*PadOperators=*/true}));        \
     CHECK_PARSE(                                                               \
         #FIELD ": AcrossEmptyLines", FIELD,                                    \
         FormatStyle::AlignConsecutiveStyle(                                    \
             {/*Enabled=*/true, /*AcrossEmptyLines=*/true,                      \
              /*AcrossComments=*/false, /*AlignCompound=*/false,                \
+             /*AlignFunctionDeclarations=*/true,                               \
              /*AlignFunctionPointers=*/false, /*PadOperators=*/true}));        \
     CHECK_PARSE(                                                               \
         #FIELD ": AcrossEmptyLinesAndComments", FIELD,                         \
         FormatStyle::AlignConsecutiveStyle(                                    \
             {/*Enabled=*/true, /*AcrossEmptyLines=*/true,                      \
              /*AcrossComments=*/true, /*AlignCompound=*/false,                 \
+             /*AlignFunctionDeclarations=*/true,                               \
              /*AlignFunctionPointers=*/false, /*PadOperators=*/true}));        \
     /* For backwards compability, false / true should still parse */           \
     CHECK_PARSE(                                                               \
         #FIELD ": false", FIELD,                                               \
         FormatStyle::AlignConsecutiveStyle(                                    \
             {/*Enabled=*/false, /*AcrossEmptyLines=*/false,                    \
              /*AcrossComments=*/false, /*AlignCompound=*/false,                \
+             /*AlignFunctionDeclarations=*/true,                               \
----------------
owenca wrote:

See [here](https://github.com/llvm/llvm-project/pull/111285/files#diff-6b5b06a9a335ec5939905df81f1def72c3f869e24c758a8dd7dc1706873a77f0R331).

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


More information about the cfe-commits mailing list