We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 675426a commit 014700fCopy full SHA for 014700f
clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -512,6 +512,13 @@ class LineJoiner {
512
} else if (TheLine->Last->isOneOf(TT_ClassLBrace, TT_StructLBrace,
513
TT_UnionLBrace)) {
514
return tryMergeRecord(I, E, Limit);
515
+ } else if (TheLine->Last->is(TT_RecordLBrace)) {
516
+ // NOTE: We use AfterClass (whereas AfterStruct exists) for both classes
517
+ // and structs, but it seems that wrapping is still handled correctly
518
+ // elsewhere.
519
+ ShouldMerge = !Style.BraceWrapping.AfterClass ||
520
+ (NextLine.First->is(tok::r_brace) &&
521
+ !Style.BraceWrapping.SplitEmptyRecord);
522
} else if (TheLine->InPPDirective ||
523
TheLine->First->isNoneOf(tok::kw_class, tok::kw_enum,
524
tok::kw_struct, Keywords.kw_record)) {
0 commit comments