diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-03-25 15:40:00 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-03-25 15:40:00 +0000 |
| commit | 167fa625f3f230a0283f18b2f0064483a85bd93b (patch) | |
| tree | 19ed7ce7bc07d26d156700dcaaf88fa2cf458d5a /clang/lib/Parse/ParseDecl.cpp | |
| parent | 9106b82ceb50093e7f433a44ef91e5c7c68dea69 (diff) | |
| download | bcm5719-llvm-167fa625f3f230a0283f18b2f0064483a85bd93b.tar.gz bcm5719-llvm-167fa625f3f230a0283f18b2f0064483a85bd93b.zip | |
Fix parsing of template classes prefixed by nested-name-specifiers
llvm-svn: 67685
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
| -rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 81685eb8ca1..a6e7d52fc13 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -497,7 +497,20 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, goto DoneWithDeclSpec; // We are looking for a qualified typename. - if (NextToken().isNot(tok::identifier)) + Token Next = NextToken(); + if (Next.is(tok::annot_template_id) && + static_cast<TemplateIdAnnotation *>(Next.getAnnotationValue()) + ->Kind == TNK_Class_template) { + // We have a qualified template-id, e.g., N::A<int> + CXXScopeSpec SS; + ParseOptionalCXXScopeSpecifier(SS); + assert(Tok.is(tok::annot_template_id) && + "ParseOptionalCXXScopeSpecifier not working"); + AnnotateTemplateIdTokenAsType(&SS); + continue; + } + + if (Next.isNot(tok::identifier)) goto DoneWithDeclSpec; CXXScopeSpec SS; @@ -512,7 +525,6 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, GetLookAheadToken(2).is(tok::l_paren)) goto DoneWithDeclSpec; - Token Next = NextToken(); TypeTy *TypeRep = Actions.getTypeName(*Next.getIdentifierInfo(), Next.getLocation(), CurScope, &SS); |

