[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 26 11:32:00 PDT 2024


================
@@ -859,8 +861,10 @@ class PackDeductionScope {
     // by this pack expansion, then clear out the deduction.
     DeducedFromEarlierParameter = !Deduced[Index].isNull();
     DeducedPack Pack(Index);
-    Pack.Saved = Deduced[Index];
-    Deduced[Index] = TemplateArgument();
+    if (!FinishingDeduction) {
+      Pack.Saved = Deduced[Index];
+      Deduced[Index] = TemplateArgument();
+    }
----------------
zygoloid wrote:

A comment describing what `FinishingDeducing` is for would be useful. It looks like the intent is that in this mode we just gather information and don't update `Deduced` at all; if so, there's an update to `Deduced` in `finishConstruction` that you might have missed.

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


More information about the cfe-commits mailing list