Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -2989,6 +2989,8 @@ FormatToken *LBrace = FormatTok; LBrace->setFinalizedType(TT_NamespaceLBrace); + // Munch the semicolon after a namespace. This is more common than one would + // think. Putting the semicolon into its own line is very ugly. parseBlock(/*MustBeDeclaration=*/true, AddLevels, /*MunchSemi=*/true, /*KeepBraces=*/nullptr, /*IfKind=*/nullptr, ManageWhitesmithsBraces); @@ -2996,11 +2998,6 @@ if (LBrace->MatchingParen) LBrace->MatchingParen->setFinalizedType(TT_NamespaceRBrace); - // Munch the semicolon after a namespace. This is more common than one would - // think. Putting the semicolon into its own line is very ugly. - if (FormatTok->is(tok::semi)) - nextToken(); - addUnwrappedLine(AddLevels > 0 ? LineLevel::Remove : LineLevel::Keep); if (ManageWhitesmithsBraces)