================ @@ -3553,6 +3553,56 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifier after constraint +// checking. +static Sema::TemplateDeductionResult +tryInstantiateExplicitSpecifier(Sema &S, FunctionDecl *Specialization, + const MultiLevelTemplateArgumentList &SubstArgs, + TemplateDeductionInfo &Info, + FunctionTemplateDecl *FunctionTemplate, + ArrayRef<TemplateArgument> DeducedArgs) { + + const auto TryInstantiateExplicitSpecifierForSingleDecl = + [&](auto *ExplicitDecl) { + ExplicitSpecifier ExplicitSpecifier = + ExplicitDecl->getExplicitSpecifier(); + Expr *const Expr = ExplicitSpecifier.getExpr(); + if (!Expr) { + return Sema::TDK_Success; + } + if (!Expr->isValueDependent()) { + return Sema::TDK_Success; + } + // TemplateDeclInstantiator::InitFunctionInstantiation set the + // ActiveInstType to TemplateInstantiation, but we need + // to enable SFINAE when instantiating explicit specifier. ---------------- LYP951018 wrote:
Should the `set` here be past tense or present tense here? `TemplateDeclInstantiator::InitFunctionInstantiation` is called before this function and I think it should be past tense... I'm not good at English :( https://github.com/llvm/llvm-project/pull/70548 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits