diff options
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 9e4600b430d..fb63899f471 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -937,6 +937,7 @@ void UnwrappedLineParser::parseEnum() { if (FormatTok->Tok.is(tok::identifier)) nextToken(); } + bool HasError = false; if (FormatTok->Tok.is(tok::l_brace)) { if (Style.BreakBeforeBraces == FormatStyle::BS_Allman) addUnwrappedLine(); @@ -952,7 +953,17 @@ void UnwrappedLineParser::parseEnum() { addUnwrappedLine(); nextToken(); --Line->Level; + if (HasError) { + if (FormatTok->is(tok::semi)) + nextToken(); + addUnwrappedLine(); + } return; + case tok::semi: + HasError = true; + nextToken(); + addUnwrappedLine(); + break; case tok::comma: nextToken(); addUnwrappedLine(); |