[clang] [clang-format] treat continuation as indent for aligned lines (PR #191217)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 13:08:51 PDT 2026


================
@@ -3560,6 +3560,28 @@ TEST_F(AlignmentTest, AlignInsidePreprocessorElseBlock) {
                Style);
 }
 
+TEST_F(AlignmentTest, ContinuedAligned) {
+  FormatStyle Style = getLLVMStyleWithColumns(60);
+  Style.UseTab = FormatStyle::UT_AlignWithSpaces;
+  Style.TabWidth = Style.IndentWidth = Style.ContinuationIndentWidth = 4;
+
+  verifyFormat("for (;;) {\n"
+               "\tif (bar(aaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbb,\n"
+               "\t        cccccccccccccccccccccccccccccc)) {\n"
+               "\t\treturn {};\n"
+               "\t}\n"
+               "}\n",
----------------
HazardyKnusperkeks wrote:

```suggestion
               "}",
```

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


More information about the cfe-commits mailing list