diff options
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 7 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 0c8d486f0eb..9631d9f71d5 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -1354,11 +1354,10 @@ void UnwrappedLineParser::parseEnum() { if (FormatTok->Tok.is(tok::l_brace)) { FormatTok->BlockKind = BK_Block; bool HasError = !parseBracedList(/*ContinueOnSemicolons=*/true); - if (HasError) { - if (FormatTok->is(tok::semi)) - nextToken(); + if (FormatTok->is(tok::semi)) + nextToken(); + if (HasError) addUnwrappedLine(); - } } // We fall through to parsing a structural element afterwards, so that in // enum A {} n, m; diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index 591d1f3a32d..f2bead3597f 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -86,6 +86,7 @@ TEST_F(FormatTestJava, ClassDeclarations) { TEST_F(FormatTestJava, EnumDeclarations) { verifyFormat("enum SomeThing { ABC, CDE }"); + verifyFormat("enum SomeThing { ABC, CDE };"); verifyFormat("enum SomeThing {\n" " ABC,\n" " CDE,\n" |

