================
@@ -11723,6 +11764,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl 
*Found, Decl *Templated,
       return;
     }
 
+    // Errors in deduction guides from inherited constructors
+    // will present as substitution failures in the mapping
+    // partial specialization, so we show a generic diagnostic
+    // in this case.
+    if (auto *DG = dyn_cast<CXXDeductionGuideDecl>(Templated);
+        DG && DG->getSourceKind() ==
+                  CXXDeductionGuideDecl::SourceKind::InheritedConstructor) {
+      CXXDeductionGuideDecl *Source = DG->getSourceDeductionGuide();
+      assert(Source &&
+             "Inherited constructor deduction guides must have a source");
+      auto DeducedRecordType =
+          QualType(cast<ClassTemplateDecl>(DG->getDeducedTemplate())
+                       ->getTemplatedDecl()
+                       ->getTypeForDecl(),
+                   0);
+      auto InheritedRecordType =
+          QualType(cast<ClassTemplateDecl>(Source->getDeducedTemplate())
+                       ->getTemplatedDecl()
+                       ->getTypeForDecl(),
+                   0);
----------------
antangelo wrote:

I think both are necessary, the code does not compile for me if I try to pass 
in a `Type *` or try to construct QualType without the Quals parameter.

https://github.com/llvm/llvm-project/pull/98788
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to