diff options
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | lib/Format/UnwrappedLineParser.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 736178e1eb..e9c6211313 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -167,15 +167,17 @@ bool UnwrappedLineParser::parseBlock(unsigned AddLevels) { assert(FormatTok.Tok.is(tok::l_brace) && "'{' expected"); nextToken(); - addUnwrappedLine(); + if (!FormatTok.Tok.is(tok::r_brace)) { + addUnwrappedLine(); - Line->Level += AddLevels; - parseLevel(/*HasOpeningBrace=*/true); - Line->Level -= AddLevels; + Line->Level += AddLevels; + parseLevel(/*HasOpeningBrace=*/true); + Line->Level -= AddLevels; - if (!FormatTok.Tok.is(tok::r_brace)) - return true; + if (!FormatTok.Tok.is(tok::r_brace)) + return true; + } nextToken(); // Munch the closing brace. return false; } |