================
@@ -957,15 +958,20 @@ static bool ShouldBreakBeforeBrace(const FormatStyle 
&Style,
   if (InitialToken.is(TT_NamespaceMacro))
     Kind = tok::kw_namespace;
 
+  const bool WrapRecordAllowed =
+      !IsEmptyBlock ||
+      Style.AllowShortRecordOnASingleLine < FormatStyle::SRS_Empty ||
+      Style.BraceWrapping.SplitEmptyRecord;
----------------
itzexpoexpo wrote:

If the block is empty, SRS is Empty or Always and SplitEmptyRecord is false we 
disable wrapping the left brace as it's in that case guaranteed that it will be 
merged onto a single line and avoids the complexity of trying to merge it in 
Formatter.
I found that the `IsEmptyBlock` condition wasn't checked in tests, removing it 
would cause a regression. It's covered in the latest commit.

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

Reply via email to