[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 16:20:24 PST 2024


gedare wrote:

Without this patch, the test case on `main`:
```
[ RUN      ] FormatTest.AlignsAfterOpenBracket
/home/gedare/rtems/llvm-project/clang/unittests/Format/FormatTestBase.h:90: Failure
Expected equality of these values:
  ExpectedCode
    Which is: "void foo(\n    void (*foobarpntr)(\n        aaaaaaaaaaaaaaaaaa *,\n        bbbbbbbbbbbbbb *,\n        cccccccccccccccccccc *,\n        dddddddddddddddddd *\n    )\n);"
  FormattedCode
    Which is: "void foo(\n    void (*foobarpntr)(aaaaaaaaaaaaaaaaaa *, bbbbbbbbbbbbbb *, cccccccccccccccccccc *, dddddddddddddddddd *)\n);"
With diff:
@@ -1,8 +1,3 @@
 void foo(
-    void (*foobarpntr)(
-        aaaaaaaaaaaaaaaaaa *,
-        bbbbbbbbbbbbbb *,
-        cccccccccccccccccccc *,
-        dddddddddddddddddd *
-    )
+    void (*foobarpntr)(aaaaaaaaaaaaaaaaaa *, bbbbbbbbbbbbbb *, cccccccccccccccccccc *, dddddddddddddddddd *)
 );

Google Test trace:
/home/gedare/rtems/llvm-project/clang/unittests/Format/FormatTest.cpp:9451: void foo(
    void (*foobarpntr)(
        aaaaaaaaaaaaaaaaaa *,
        bbbbbbbbbbbbbb *,
        cccccccccccccccccccc *,
        dddddddddddddddddd *
    )
);

[  FAILED  ] FormatTest.AlignsAfterOpenBracket (379 ms)
```

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


More information about the cfe-commits mailing list