diff options
author | John McCall <rjmccall@apple.com> | 2009-12-12 11:40:51 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-12-12 11:40:51 +0000 |
commit | 9dab4e68b96552f181fc38a8b8b793273d1f3a51 (patch) | |
tree | 402c70fb19217cbbd84c5d598280289f5df54909 /clang/lib/Parse/ParseDecl.cpp | |
parent | 401e6093c9a16c370e841a7bb0054af55ea76691 (diff) | |
download | bcm5719-llvm-9dab4e68b96552f181fc38a8b8b793273d1f3a51.tar.gz bcm5719-llvm-9dab4e68b96552f181fc38a8b8b793273d1f3a51.zip |
Remember the type name's scope specifier in the DeclSpec.
llvm-svn: 91215
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index efac0c4a030..5dd78f7b547 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -824,14 +824,18 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, if (DS.hasTypeSpecifier()) goto DoneWithDeclSpec; + CXXScopeSpec SS; + SS.setScopeRep(Tok.getAnnotationValue()); + SS.setRange(Tok.getAnnotationRange()); + // We are looking for a qualified typename. Token Next = NextToken(); if (Next.is(tok::annot_template_id) && static_cast<TemplateIdAnnotation *>(Next.getAnnotationValue()) ->Kind == TNK_Type_template) { // We have a qualified template-id, e.g., N::A<int> - CXXScopeSpec SS; - ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/0, true); + DS.getTypeSpecScope() = SS; + ConsumeToken(); // The C++ scope. assert(Tok.is(tok::annot_template_id) && "ParseOptionalCXXScopeSpecifier not working"); AnnotateTemplateIdTokenAsType(&SS); @@ -839,8 +843,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, } if (Next.is(tok::annot_typename)) { - // FIXME: is this scope-specifier getting dropped? - ConsumeToken(); // the scope-specifier + DS.getTypeSpecScope() = SS; + ConsumeToken(); // The C++ scope. if (Tok.getAnnotationValue()) isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec, DiagID, @@ -854,10 +858,6 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, if (Next.isNot(tok::identifier)) goto DoneWithDeclSpec; - CXXScopeSpec SS; - SS.setScopeRep(Tok.getAnnotationValue()); - SS.setRange(Tok.getAnnotationRange()); - // If the next token is the name of the class type that the C++ scope // denotes, followed by a '(', then this is a constructor declaration. // We're done with the decl-specifiers. @@ -879,6 +879,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, goto DoneWithDeclSpec; } + DS.getTypeSpecScope() = SS; ConsumeToken(); // The C++ scope. isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec, |