diff options
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index b56140e763d..ef55b681940 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -668,6 +668,12 @@ void UnwrappedLineParser::parseStructuralElement() { case tok::kw_enum: parseEnum(); break; + case tok::kw_typedef: + nextToken(); + // FIXME: Use the IdentifierTable instead. + if (FormatTok->TokenText == "NS_ENUM") + parseEnum(); + break; case tok::kw_struct: case tok::kw_union: case tok::kw_class: @@ -1129,7 +1135,10 @@ void UnwrappedLineParser::parseAccessSpecifier() { } void UnwrappedLineParser::parseEnum() { - nextToken(); + if (FormatTok->Tok.is(tok::kw_enum)) { + // Won't be 'enum' for NS_ENUMs. + nextToken(); + } // Eat up enum class ... if (FormatTok->Tok.is(tok::kw_class) || FormatTok->Tok.is(tok::kw_struct)) |

