diff options
author | Daniel Jasper <djasper@google.com> | 2014-11-03 03:00:42 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-11-03 03:00:42 +0000 |
commit | 5f2764d88687910b6eb013b6e1c1e9744fc1ce93 (patch) | |
tree | 2ab3a0e38e6c9b6c76c325fed629fe3d444a00a6 /clang/lib/Format | |
parent | f056f45b77e6e06fe9477e600df974846d8cf096 (diff) | |
download | bcm5719-llvm-5f2764d88687910b6eb013b6e1c1e9744fc1ce93.tar.gz bcm5719-llvm-5f2764d88687910b6eb013b6e1c1e9744fc1ce93.zip |
clang-format: [Java] Allow trailing semicolons after enums.
Before:
enum SomeThing { ABC, CDE }
;
After:
enum SomeThing { ABC, CDE };
llvm-svn: 221125
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 7 |
1 files changed, 3 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; |