================
@@ -231,14 +231,18 @@ Response HandleFunctionTemplateDecl(const
FunctionTemplateDecl *FTD,
MultiLevelTemplateArgumentList &Result) {
if (!isa<ClassTemplateSpecializationDecl>(FTD->getDeclContext())) {
NestedNameSpecifier *NNS = FTD->getTemplatedDecl()->getQualifier();
- const Type *Ty;
- const TemplateSpecializationType *TSTy;
- if (NNS && (Ty = NNS->getAsType()) &&
- (TSTy = Ty->getAs<TemplateSpecializationType>()))
- Result.addOuterTemplateArguments(const_cast<FunctionTemplateDecl *>(FTD),
- TSTy->template_arguments(),
- /*Final=*/false);
+
+ while (const Type *Ty = NNS ? NNS->getAsType() : nullptr) {
----------------
erichkeane wrote:
So that one you're seeing there is for the `InnerClass` on line 13, the
`NestedNameSpecifier` is for 'everything else' outside of that declaration. So
in THAT case, the Prefix of that one is nothing, since the `Base<T>` is the
entirety of the thing.
However, that AST doesn't show the `NNS` of `func` on line 22, for some reason
we're not dumping that. In THAT case, the `NNS` is `Base<T>::InnerClass`. At
that point, the `InnerClass` doesn't have template arguments (since it isn't a
template!), but its `Prefix` is just the `Base<T>`, which has them (which is
why/how this loop works).
https://github.com/llvm/llvm-project/pull/65993
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits