[clang] [clang-format] Remove special handling of comments after brace/paren (PR #71672)

via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 11 15:15:34 PDT 2026


================
@@ -925,7 +925,12 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
                         TT_TableGenDAGArgOpenerToBreak) &&
       !(Current.MacroParent && Previous.MacroParent) &&
       (Current.isNot(TT_LineComment) ||
-       Previous.isOneOf(BK_BracedInit, TT_VerilogMultiLineListLParen)) &&
+       (Previous.is(BK_BracedInit) &&
+        (Style.Cpp11BracedListStyle != FormatStyle::BLS_FunctionCall ||
+         !Previous.Previous ||
+         Previous.Previous->isNoneOf(tok::identifier, tok::l_paren,
----------------
sstwcw wrote:

I see that this piece of code is there to tell apart `x{}` from `x = {}`.  But I don't see why they should be treated differently.  Only the `FunctionCall` style has the distinction.  I thought the option `Cpp11BracedListStyle` started as a bool meaning whether or not to format all braced lists in the style that is good for C++ 11.

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


More information about the cfe-commits mailing list