@@ -3313,10 +3313,12 @@ FinishTemplateArgumentDeduction(
3313
3313
if (Trap.hasErrorOccurred ())
3314
3314
return TemplateDeductionResult::SubstitutionFailure;
3315
3315
3316
- if (auto Result = CheckDeducedArgumentConstraints (S, Partial, SugaredBuilder,
3317
- CanonicalBuilder, Info);
3318
- Result != TemplateDeductionResult::Success)
3319
- return Result;
3316
+ if (!IsPartialOrdering) {
3317
+ if (auto Result = CheckDeducedArgumentConstraints (
3318
+ S, Partial, SugaredBuilder, CanonicalBuilder, Info);
3319
+ Result != TemplateDeductionResult::Success)
3320
+ return Result;
3321
+ }
3320
3322
3321
3323
return TemplateDeductionResult::Success;
3322
3324
}
@@ -3364,13 +3366,16 @@ static TemplateDeductionResult FinishTemplateArgumentDeduction(
3364
3366
if (Trap.hasErrorOccurred ())
3365
3367
return TemplateDeductionResult::SubstitutionFailure;
3366
3368
3367
- if (auto Result = CheckDeducedArgumentConstraints (S, Template, SugaredBuilder,
3368
- CanonicalBuilder, Info);
3369
- Result != TemplateDeductionResult::Success)
3370
- return Result;
3369
+ if (!PartialOrdering) {
3370
+ if (auto Result = CheckDeducedArgumentConstraints (
3371
+ S, Template, SugaredBuilder, CanonicalBuilder, Info);
3372
+ Result != TemplateDeductionResult::Success)
3373
+ return Result;
3374
+ }
3371
3375
3372
3376
return TemplateDeductionResult::Success;
3373
3377
}
3378
+
3374
3379
// / Complete template argument deduction for DeduceTemplateArgumentsFromType.
3375
3380
// / FIXME: this is mostly duplicated with the above two versions. Deduplicate
3376
3381
// / the three implementations.
@@ -5595,19 +5600,8 @@ static TemplateDeductionResult FinishTemplateArgumentDeduction(
5595
5600
TDR != TemplateDeductionResult::Success)
5596
5601
return TDR;
5597
5602
5598
- // C++20 [temp.deduct]p5 - Only check constraints when all parameters have
5599
- // been deduced.
5600
- if (!IsIncomplete) {
5601
- if (auto Result = CheckDeducedArgumentConstraints (S, FTD, SugaredBuilder,
5602
- CanonicalBuilder, Info);
5603
- Result != TemplateDeductionResult::Success)
5604
- return Result;
5605
- }
5606
-
5607
- if (Trap.hasErrorOccurred ())
5608
- return TemplateDeductionResult::SubstitutionFailure;
5609
-
5610
- return TemplateDeductionResult::Success;
5603
+ return Trap.hasErrorOccurred () ? TemplateDeductionResult::SubstitutionFailure
5604
+ : TemplateDeductionResult::Success;
5611
5605
}
5612
5606
5613
5607
// / Determine whether the function template \p FT1 is at least as
0 commit comments