[clang] [clang-format] Add option AllowShortRecordOnASingleLine (PR #154580)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 4 11:58:07 PST 2025


================
@@ -266,15 +267,22 @@ class LineJoiner {
       }
     }
 
+    // Try merging record blocks that have had their left brace wrapped into
+    // a single line.
+    if (NextLine.First->isOneOf(TT_ClassLBrace, TT_StructLBrace,
+                                TT_UnionLBrace)) {
+      if (unsigned MergedLines = tryMergeRecord(I, E, Limit))
+        return MergedLines;
+    }
+
     const auto *PreviousLine = I != AnnotatedLines.begin() ? I[-1] : nullptr;
-    // Handle empty record blocks where the brace has already been wrapped.
+
+    // Handle blocks where the brace has already been wrapped.
----------------
HazardyKnusperkeks wrote:

Why did you change the wording?

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


More information about the cfe-commits mailing list