[clang] [clang-format] Support fine-grained alignment of variable declarations (PR #160270)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 1 09:46:29 PDT 2025


================
@@ -20323,6 +20323,61 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) {
                "void f2(void);\n"
                "size_t f3(void);",
                Alignment);
+
+  Alignment.AlignConsecutiveDeclarations.AlignFreeVariableDeclarations = false;
+  verifyFormat("int func() { //\n"
+               "  int local1;\n"
+               "  unsigned local2;\n"
----------------
gedare wrote:

I think you should add a function pointer to the free and member variables, to show they don't override the setting of `AlignFunctionPointers`.

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


More information about the cfe-commits mailing list