Properly handle the template template args in global scope.
Also properly handle the case where the template template argument as a partially qualified scope
This commit is contained in:
parent
29746d4caf
commit
443fe10fd8
@ -186,26 +186,31 @@ namespace utils {
|
||||
static bool
|
||||
GetFullyQualifiedTemplateName(const ASTContext& Ctx, TemplateName &tname) {
|
||||
|
||||
bool changed = false;
|
||||
TemplateDecl *argtdecl = tname.getAsTemplateDecl();
|
||||
QualifiedTemplateName *qtname = tname.getAsQualifiedTemplateName();
|
||||
if (qtname && !qtname->hasTemplateKeyword()) {
|
||||
NestedNameSpecifier *NNS = qtname->getQualifier();
|
||||
NestedNameSpecifier *qNNS
|
||||
= GetFullyQualifiedNameSpecifier(Ctx,NNS);
|
||||
if (qNNS != NNS) {
|
||||
changed = true;
|
||||
NNS = qNNS;
|
||||
}
|
||||
} else {
|
||||
NestedNameSpecifier *NNS =
|
||||
CreateNestedNameSpecifierForScopeOf(Ctx, argtdecl, true);
|
||||
tname = Ctx.getQualifiedTemplateName(NNS,
|
||||
/*TemplateKeyword=*/ false,
|
||||
argtdecl);
|
||||
bool changed = false;
|
||||
NestedNameSpecifier *NNS = 0;
|
||||
|
||||
TemplateDecl *argtdecl = tname.getAsTemplateDecl();
|
||||
QualifiedTemplateName *qtname = tname.getAsQualifiedTemplateName();
|
||||
|
||||
if (qtname && !qtname->hasTemplateKeyword()) {
|
||||
NNS = qtname->getQualifier();
|
||||
NestedNameSpecifier *qNNS = GetFullyQualifiedNameSpecifier(Ctx,NNS);
|
||||
if (qNNS != NNS) {
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
NNS = qNNS;
|
||||
} else {
|
||||
NNS = 0;
|
||||
}
|
||||
} else {
|
||||
NNS = CreateNestedNameSpecifierForScopeOf(Ctx, argtdecl, true);
|
||||
}
|
||||
if (NNS) {
|
||||
tname = Ctx.getQualifiedTemplateName(NNS,
|
||||
/*TemplateKeyword=*/ false,
|
||||
argtdecl);
|
||||
changed = true;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user