[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 5 19:53:29 PDT 2024


================
@@ -2143,15 +2107,17 @@ static TemplateDeductionResult DeduceTemplateArgumentsByTypeMatch(
       unsigned SubTDF = TDF & TDF_IgnoreQualifiers;
       if (auto Result = DeduceTemplateArgumentsByTypeMatch(
               S, TemplateParams, PPT, APT, Info, Deduced, SubTDF,
-              /*PartialOrdering=*/false, /*DeducedFromArrayBound=*/false,
-              HasDeducedAnyParam);
+              POK != PartialOrderingKind::None ? PartialOrderingKind::NonCall
----------------
mizvekov wrote:

Yes, this is slightly complicated because I tried to do an enum instead of adding another bool.

Basically we want to add a new flag to the deduction functions saying that we are in a partial ordering context, which needs to be propagated deeply.

We already had one such flag, but this one was for supporting deduction of function calls, and it had shallow propagation. So this is the transfer function for the shallow Call Partial ordering mode into the deep non-call mode.

https://github.com/llvm/llvm-project/pull/94981


More information about the cfe-commits mailing list