diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index c6bf71adbf1..c8e4cc4a1b6 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -902,6 +902,7 @@ void UnwrappedLineParser::parseStructuralElement() { break; } do { + const FormatToken *Previous = getPreviousToken(); switch (FormatTok->Tok.getKind()) { case tok::at: nextToken(); @@ -909,6 +910,12 @@ void UnwrappedLineParser::parseStructuralElement() { parseBracedList(); break; case tok::kw_enum: + // Ignore if this is part of "template <enum ...". + if (Previous && Previous->is(tok::less)) { + nextToken(); + break; + } + // parseEnum falls through and does not yet add an unwrapped line as an // enum definition can start a structural element. if (!parseEnum()) |

