================
@@ -895,6 +889,11 @@ class LineJoiner {
         Line.startsWithExportBlock()) {
       if (IsSplitBlock)
         return 0;
+      // The construct-specific options AllowShortIfStatementsOnASingleLine and
+      // AllowShortLoopsOnASingleLine take precedence over
+      // AllowShortBlocksOnASingleLine: a statement whose specific option
+      // disallows merging is not put on a single line even when short blocks
+      // are always allowed.
----------------
rudolflovrencic wrote:

@gedare Thanks, I've built your branch - it works and seems elegant. Sorry if I 
kept pulling in the wrong direction:)

Is there something similar we could do to fix `v22` breakage for records?

`clang-format --style="{BasedOnStyle: LLVM, BreakBeforeBraces: Custom, 
BraceWrapping: {AfterStruct: true}, AllowShortBlocksOnASingleLine: true, 
AllowShortRecordOnASingleLine: Empty}" /tmp/test.cpp`

Produced:
```c++
struct foo
{
};
struct bar
{ int i; };
```

Desired:
```c++
struct foo {};
struct bar
{
  int i;
};
```

https://github.com/llvm/llvm-project/pull/196021
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to