[clang] No spaces after colon and comma in initializer list (PR #190657)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 8 11:50:05 PDT 2026
================
@@ -5537,6 +5537,11 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
Left.isOneOf(TT_TrailingReturnArrow, TT_LambdaArrow)) {
return true;
}
+ if (Left.is(tok::comma) && Left.is(TT_CtorInitializerComma) &&
+ Right.isNot(TT_OverloadedOperatorLParen) &&
+ (Left.Children.empty() || !Left.MacroParent)) {
+ return Style.SpaceAfterCtorInitializerComma;
+ }
----------------
HazardyKnusperkeks wrote:
```suggestion
if (Left.is(TT_CtorInitializerComma))
return Style.SpaceAfterCtorInitializerComma;
```
Why do you think you need all those checks?
https://github.com/llvm/llvm-project/pull/190657
More information about the cfe-commits
mailing list