@@ -3863,7 +3863,7 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction(
38633863 FD = const_cast <FunctionDecl *>(FDFriend);
38643864 Owner = FD->getLexicalDeclContext ();
38653865 }
3866- # if 1
3866+ // [DR2369]
38673867 // FIXME: We have to partially instantiate lambda's captures for constraint
38683868 // evaluation.
38693869 if (!isLambdaCallOperator (FD) && !isLambdaConversionOperator (FD) &&
@@ -3894,9 +3894,6 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction(
38943894 /* SkipForSpecialization=*/ false ,
38953895 /* Merged=*/ &MLTAL);
38963896
3897- // if (SetupConstraintScope(FD, SugaredBuilder, MLTAL, Scope))
3898- // return TemplateDeductionResult::MiscellaneousDeductionFailure;
3899-
39003897 MultiLevelTemplateArgumentList JustTemplArgs (
39013898 Template, CanonicalDeducedArgumentList->asArray (),
39023899 /* Final=*/ false );
@@ -3921,7 +3918,7 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction(
39213918 CXXThisScopeRAII ThisScope (*this , Record, ThisQuals, Record != nullptr );
39223919 llvm::SmallVector<Expr *, 1 > Converted;
39233920 if (CheckConstraintSatisfaction (Template, TemplateAC, MLTAL,
3924- Template-> getSourceRange (),
3921+ Info. getLocation (),
39253922 Info.AssociatedConstraintsSatisfaction ))
39263923 return TemplateDeductionResult::MiscellaneousDeductionFailure;
39273924 if (!Info.AssociatedConstraintsSatisfaction .IsSatisfied ) {
@@ -3931,7 +3928,18 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction(
39313928 }
39323929 }
39333930 }
3934- #endif
3931+
3932+ // C++ [temp.deduct.call]p10: [DR1391]
3933+ // If deduction succeeds for all parameters that contain
3934+ // template-parameters that participate in template argument deduction,
3935+ // and all template arguments are explicitly specified, deduced, or
3936+ // obtained from default template arguments, remaining parameters are then
3937+ // compared with the corresponding arguments. For each remaining parameter
3938+ // P with a type that was non-dependent before substitution of any
3939+ // explicitly-specified template arguments, if the corresponding argument
3940+ // A cannot be implicitly converted to P, deduction fails.
3941+ if (CheckNonDependent ())
3942+ return TemplateDeductionResult::NonDependentConversionFailure;
39353943
39363944 MultiLevelTemplateArgumentList SubstArgs (
39373945 FunctionTemplate, CanonicalDeducedArgumentList->asArray (),
@@ -3982,18 +3990,6 @@ TemplateDeductionResult Sema::FinishTemplateArgumentDeduction(
39823990 }
39833991 }
39843992
3985- // C++ [temp.deduct.call]p10: [DR1391]
3986- // If deduction succeeds for all parameters that contain
3987- // template-parameters that participate in template argument deduction,
3988- // and all template arguments are explicitly specified, deduced, or
3989- // obtained from default template arguments, remaining parameters are then
3990- // compared with the corresponding arguments. For each remaining parameter
3991- // P with a type that was non-dependent before substitution of any
3992- // explicitly-specified template arguments, if the corresponding argument
3993- // A cannot be implicitly converted to P, deduction fails.
3994- if (CheckNonDependent ())
3995- return TemplateDeductionResult::NonDependentConversionFailure;
3996-
39973993 // We skipped the instantiation of the explicit-specifier during the
39983994 // substitution of `FD` before. So, we try to instantiate it back if
39993995 // `Specialization` is either a constructor or a conversion function.
0 commit comments