Fix parsing of template classes prefixed by nested-name-specifiers
llvm-svn: 67685
This commit is contained in:
parent
9106b82ceb
commit
167fa625f3
@ -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);
|
||||
|
||||
|
||||
@ -28,3 +28,11 @@ B<17 + 2> *bar(B<(19)> *ptr1, B< (::value + 7) > *ptr2, B<19 - 3> *ptr3) {
|
||||
}
|
||||
|
||||
typedef B<5> B5;
|
||||
|
||||
|
||||
namespace N {
|
||||
template<typename T> struct C {};
|
||||
}
|
||||
|
||||
N::C<int> c1;
|
||||
typedef N::C<float> c2;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user