diff options
| -rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Parser/cxx-decl.cpp | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 8ce4c9aa2e7..f17212d9b3a 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -3804,7 +3804,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, DS.SetRangeEnd(Tok.getLocation()); if (DiagID != diag::err_bool_redeclaration) - ConsumeToken(); + // After an error the next token can be an annotation token. + ConsumeAnyToken(); AttrsLastTime = false; } diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp index 1a24520b8f5..e1b36ecfa93 100644 --- a/clang/test/Parser/cxx-decl.cpp +++ b/clang/test/Parser/cxx-decl.cpp @@ -298,6 +298,11 @@ inline namespace ParensAroundFriend { // expected-error 0-1{{C++11}} } } +namespace rdar37099386 { + class A typename A; // expected-error {{expected a qualified name after 'typename'}} + // expected-error@-1 {{cannot combine with previous 'class' declaration specifier}} +} + // PR8380 extern "" // expected-error {{unknown linkage language}} test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} |

