[clang] [ClangFormat] Fix indent in child lines within a macro argument. (PR #82523)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 00:24:32 PST 2024


================
@@ -287,6 +287,21 @@ TEST_F(FormatTestMacroExpansion,
                Style);
 }
 
+TEST_F(FormatTestMacroExpansion, IndentChildrenWithinMacroCall) {
+  FormatStyle Style = getGoogleStyleWithColumns(22);
+  Style.Macros.push_back("MACRO(a, b)=a=(b)");
+  verifyFormat("void f() {\n"
+               "  MACRO(a b, call([] {\n"
+               "          if (expr) {\n"
+               "            indent();\n"
+               "          }\n"
+               "        }));\n"
+               "}"
+
+               ,
----------------
owenca wrote:

```suggestion
               "}",
```

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


More information about the cfe-commits mailing list