diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-28 07:26:33 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-28 07:26:33 +0000 |
commit | c5790dfeb4535d417f82e724ae4013a337191c8e (patch) | |
tree | dd17a14cea4067532c5bcb9ac74c5a588bf9f506 /clang/lib/Parse/ParseDecl.cpp | |
parent | 0261b5d2d2f59da443196f11eb17af3aee8a4480 (diff) | |
download | bcm5719-llvm-c5790dfeb4535d417f82e724ae4013a337191c8e.tar.gz bcm5719-llvm-c5790dfeb4535d417f82e724ae4013a337191c8e.zip |
Parse a C++ scope specifier followed by a "typename" annotation token as a type name within the declaration specifiers. Fixes PR5061.
llvm-svn: 82974
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 2dac473cc6c..d885558e1f3 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -778,6 +778,19 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, continue; } + if (Next.is(tok::annot_typename)) { + // FIXME: is this scope-specifier getting dropped? + ConsumeToken(); // the scope-specifier + if (Tok.getAnnotationValue()) + isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, + PrevSpec, DiagID, + Tok.getAnnotationValue()); + else + DS.SetTypeSpecError(); + DS.SetRangeEnd(Tok.getAnnotationEndLoc()); + ConsumeToken(); // The typename + } + if (Next.isNot(tok::identifier)) goto DoneWithDeclSpec; |