diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp index b0314d6cfa75fb..c789f2907dac97 100644 --- a/clang/lib/Format/UnwrappedLineFormatter.cpp +++ b/clang/lib/Format/UnwrappedLineFormatter.cpp @@ -511,12 +511,11 @@ class LineJoiner { ShouldMerge = !Style.BraceWrapping.AfterClass || (NextLine.First->is(tok::r_brace) && !Style.BraceWrapping.SplitEmptyRecord); - } else { + } if(TheLine->InPPDirective || + !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum, + tok::kw_struct)) { // Try to merge a block with left brace unwrapped that wasn't yet // covered. - assert(TheLine->InPPDirective || - !TheLine->First->isOneOf(tok::kw_class, tok::kw_enum, - tok::kw_struct)); ShouldMerge = !Style.BraceWrapping.AfterFunction || (NextLine.First->is(tok::r_brace) && !Style.BraceWrapping.SplitEmptyFunction);