[clang] Fix out of line Concept-comparisons of NestedNameSpecifiers (PR #65993)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 11 14:05:33 PDT 2023


================
@@ -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:

I don't understand what you mean?  `TagDecl` (IIRC?) has a `getQualifier()` to get the appropriate `NestedNameSpecifier`.  I believe our NNS tree is correct the way I've implemented it above, with the exception of the issue I posted about a moment ago.

https://github.com/llvm/llvm-project/pull/65993


More information about the cfe-commits mailing list