Skip to content

Commit 1aa5aae

Browse files
committed
[REVISIT] Fix desugared prefix issue
1 parent f2a63e8 commit 1aa5aae

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

core/clingutils/src/TClingUtils.cxx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4830,12 +4830,15 @@ clang::QualType ROOT::TMetaUtils::ReSubstTemplateArg(clang::QualType input, cons
48304830
clang::Qualifiers scope_qualifiers = input.getLocalQualifiers();
48314831
assert(instance->getAsCXXRecordDecl() != nullptr && "ReSubstTemplateArg only makes sense with a type representing a class.");
48324832

4833-
clang::QualType subTy = input;
4834-
if (desugaredPrefix.getKind() == NestedNameSpecifier::Kind::Type)
4835-
subTy = ReSubstTemplateArg(clang::QualType(desugaredPrefix.getAsType(),0),instance);
4836-
4837-
subTy = Ctxt.getQualifiedType(subTy,scope_qualifiers);
4838-
return subTy;
4833+
if (desugaredPrefix.getKind() == NestedNameSpecifier::Kind::Type) {
4834+
clang::QualType subTy = ReSubstTemplateArg(clang::QualType(desugaredPrefix.getAsType(),0),instance);
4835+
subTy = Ctxt.getQualifiedType(subTy,scope_qualifiers);
4836+
return subTy;
4837+
}
4838+
// For namespace prefixes (e.g. std::), do NOT return early.
4839+
// The SubstTemplateTypeParmType nodes are inside the template args
4840+
// of the type itself. Fall through so the substitution logic below
4841+
// can replace them (e.g. double -> Double32_t).
48394842
}
48404843

48414844
QualType QT = input;

0 commit comments

Comments
 (0)