[clang] [clang] Implement CTAD for type alias template. (PR #77890)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 6 01:18:06 PST 2024


================
@@ -6286,8 +6284,18 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
           QualType T = CheckTemplateIdType(TemplateName(TD), Loc, Args);
           if (T.isNull())
             return nullptr;
-          auto *SubstRecord = T->getAsCXXRecordDecl();
-          assert(SubstRecord && "class template id not a class type?");
+          CXXRecordDecl *SubstRecord = T->getAsCXXRecordDecl();
+
+          if (!SubstRecord) {
+            // The T can be a dependent TemplateSpecializationType when
+            // performing a substitution for building a deduction guide,
----------------
cor3ntin wrote:

```suggestion
            // T can be a dependent TemplateSpecializationType when
            // performing a substitution for building a deduction guide.
```

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


More information about the cfe-commits mailing list