================ @@ -1107,8 +1172,32 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef, Sema::CodeSynthesisContext::BuildingDeductionGuides)) { auto *GG = cast<CXXDeductionGuideDecl>(FPrime); - Expr *IsDeducible = buildIsDeducibleConstraint( - SemaRef, AliasTemplate, FPrime->getReturnType(), FPrimeTemplateParams); + TypeSourceInfo *TSI = GG->getTypeSourceInfo(); + QualType ReturnType = FPrime->getReturnType(); + TemplateDecl *DeducedTemplate = + FromInheritedCtor ? FromInheritedCtor->DerivedClassTemplate + : AliasTemplate; + if (FromInheritedCtor) { + TSI = buildInheritedConstructorDeductionGuideType( + SemaRef, *FromInheritedCtor, TSI); + if (!TSI) + return nullptr; + ReturnType = TSI->getType() + .getTypePtr() + ->getAs<FunctionProtoType>() + ->getReturnType(); + } + + // We omit the deducible constraint for inherited constructor deduction + // guides because they would take precedence over the derived class' own + // deduction guides due to [over.match.best.general]p2.5 and + // [temp.func.order]p6.4 If the alias were not deducible in this case, the + // deduction guide would already not be deducible due to the partial + // specialization `CC<>` failing substitution. ---------------- cor3ntin wrote:
Did we decide this is correct? Should it not be a conjunction? 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