diff options
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 2 | ||||
-rw-r--r-- | test/Parser/cxx-decl.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 277d69f2cd..4405dcb974 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -865,6 +865,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, DS.SetTypeSpecError(); goto DoneWithDeclSpec; } + if (Tok.is(tok::coloncolon)) // ::new or ::delete + goto DoneWithDeclSpec; continue; case tok::annot_cxxscope: { diff --git a/test/Parser/cxx-decl.cpp b/test/Parser/cxx-decl.cpp index f37604cc54..c8f2c0b769 100644 --- a/test/Parser/cxx-decl.cpp +++ b/test/Parser/cxx-decl.cpp @@ -58,3 +58,7 @@ struct test4 { int y; int z // expected-error {{expected ';' at end of declaration list}} }; + +// PR5825 +struct test5 {}; +::new(static_cast<void*>(0)) test5; // expected-error {{expected unqualified-id}} |