In TypeName::GetFullyQualifiedType, strip SubstTemplateTypeParmType.

When the type comes (directly or indirectly) from being used as a template paramater, it is decorated
by SubstTemplateTypeParmType which gets in the way of properly getting the name correct (leads to
'std::const string'.
This commit is contained in:
Philippe Canal 2015-09-24 04:01:18 -05:00 committed by sftnight
parent df44a9d01d
commit f1fd8d0fd0

View File

@ -1515,6 +1515,19 @@ namespace utils {
return QT;
}
// Remove the part of the type related to the type being a template
// parameter (we won't report it as part of the 'type name' and it is
// actually make the code below to be more complex (to handle those)
while (isa<SubstTemplateTypeParmType>(QT.getTypePtr())) {
// Get the qualifiers.
Qualifiers quals = QT.getQualifiers();
QT = dyn_cast<SubstTemplateTypeParmType>(QT.getTypePtr())->desugar();
// Add back the qualifiers.
QT = Ctx.getQualifiedType(QT, quals);
}
NestedNameSpecifier* prefix = 0;
Qualifiers prefix_qualifiers;
if (const ElaboratedType* etype_input