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 | 9d7b35303c6f1eaee85039d0f934c456e063cd0a (patch) | |
tree | f335aa54c6ebe6e542ab65accd7583666eca520b /lib/Parse/ParseDecl.cpp | |
parent | 0d696533420fca4cf32694621e3edf582ad4d06e (diff) |
Parse a C++ scope specifier followed by a "typename" annotation token as a type name within the declaration specifiers. Fixes PR5061.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82974 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 2dac473cc6..d885558e1f 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/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; |