================
@@ -1173,25 +1276,52 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
         NewParam->setScopeInfo(0, I);
         FPTL.setParam(I, NewParam);
       }
-      auto *Transformed = cast<FunctionDecl>(buildDeductionGuide(
-          SemaRef, AliasTemplate, /*TemplateParams=*/nullptr,
+
+      QualType ReturnType =
+          cast<FunctionProtoType>(FunctionType->getType())->getReturnType();
+      if (FromInheritedCtor) {
+        FunctionType = buildInheritedConstructorDeductionGuideType(
+            SemaRef, *FromInheritedCtor, FunctionType);
+        if (!FunctionType)
+          continue;
+        ReturnType = FunctionType->getType()
+                         .getTypePtr()
+                         ->getAs<FunctionProtoType>()
+                         ->getReturnType();
+      }
----------------
mizvekov wrote:

There is a lot of commonality with this block here and another that appears in 
`BuildDeductionGuideForTypeAlias`, can we factor it out?

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