[PATCH] D137762: [clang-format] avoid breaking )( with BlockIndent

Gedare Bloom via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 10 21:56:55 PST 2022


gedare added inline comments.


================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:720
       (!Previous.Previous || !Previous.Previous->isOneOf(
-                                 tok::kw_for, tok::kw_while, tok::kw_switch)) &&
+                  tok::r_paren,  tok::kw_for, tok::kw_while, tok::kw_switch)) &&
       // Don't do this for simple (no expressions) one-argument function calls
----------------
MyDeveloperDay wrote:
> this would likely have been added for a reason, did this not break any tests?
This does break the tests using AlwaysBreak (Google Test), it reformats
```
-    size_t foo = (*(function))(
-        Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
-        FoooooooooLooooong);
+    size_t foo =
+        (*(function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong,
+                      BarrrrrrrrrrrrLong, FoooooooooLooooong);
```

This is my bad, sending my first patch to llvm/clang and trying to figure out the code/commit/test/review cycle. I'll work on resolving this, and adding / checking that the BlockIndent unittest covers the new behavior properly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137762/new/

https://reviews.llvm.org/D137762



More information about the cfe-commits mailing list