diff options
| -rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 8 | ||||
| -rw-r--r-- | clang/test/Parser/cxx0x-attributes.cpp | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 1c38979faef..10568b3671b 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -3386,9 +3386,11 @@ IdentifierInfo *Parser::TryParseCXX11AttributeIdentifier(SourceLocation &Loc) { switch (Tok.getKind()) { default: // Identifiers and keywords have identifier info attached. - if (IdentifierInfo *II = Tok.getIdentifierInfo()) { - Loc = ConsumeToken(); - return II; + if (!Tok.isAnnotation()) { + if (IdentifierInfo *II = Tok.getIdentifierInfo()) { + Loc = ConsumeToken(); + return II; + } } return nullptr; diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp index 9dbefb0f483..c68a119fc74 100644 --- a/clang/test/Parser/cxx0x-attributes.cpp +++ b/clang/test/Parser/cxx0x-attributes.cpp @@ -334,3 +334,10 @@ namespace { [[deprecated()]] void foo(); // expected-error {{parentheses must be omitted if 'deprecated' attribute's argument list is empty}} [[gnu::deprecated()]] void quux(); } + +namespace { +[[ // expected-error {{expected ']'}} +#pragma pack(pop) +deprecated +]] void bad(); +} |

