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

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 27 15:28:02 PDT 2025


================
@@ -4699,6 +4699,55 @@ TEST_F(FormatTestComments, SplitCommentIntroducers) {
                    getLLVMStyleWithColumns(10)));
 }
 
+TEST_F(FormatTestComments, LineCommentsOnStartOfFunctionCall) {
+  auto Style = getLLVMStyle();
+
+  EXPECT_TRUE(Style.Cpp11BracedListStyle);
+
+  verifyFormat("T foo( // Comment\n"
+               "    arg);",
+               Style);
+
+  verifyFormat("T bar{ // Comment\n"
+               "    arg};",
+               Style);
+
+  verifyFormat("T baz({ // Comment\n"
+               "        arg});",
----------------
HazardyKnusperkeks wrote:

I'm still investigating. There seems to happen something...
```
State: F|0|0|0 (|6|0|0 {|4|0|0 // Comment
State: F|0|0|0 (|6|0|0 {|8|0|0 arg
```

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


More information about the cfe-commits mailing list