================
@@ -1237,6 +1237,13 @@ unsigned 
ContinuationIndenter::addTokenOnNewLine(LineState &State,
           Style.ContinuationIndentWidth;
     }
   }
+  if ((Style.BreakInheritanceList == FormatStyle::BILS_AfterComma ||
+       Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon) &&
+      Previous.isOneOf(TT_InheritanceComma, tok::comma) &&
----------------
HazardyKnusperkeks wrote:

I'm afraid this isn't good enough, although unlikely in real code.

```
void foo() {
int i // comment
, j;
}
```
Will change it's formatting:
Before:
```
format "void foo {int i //comment\n,j;}" --style="{UseTab: AlignWithSpaces, 
TabWidth: 4}" | sed -n l
void foo {$
  int i // comment$
\t  ,$
\t  j;$
}$
```

After:
```
format "void foo {int i //comment\n,j;}" --style="{UseTab: AlignWithSpaces, 
TabWidth: 4}" | sed -n l
void foo {$
  int i // comment$
\t  ,$
      j;$
}$
```

https://github.com/llvm/llvm-project/pull/189218
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to