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

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 26 11:49:37 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();
+    }
----------------
mizvekov wrote:

Will do.

Yeah that's exactly it. The idea is to reuse the parts of the PackScope which help iterating a pack, but in a context where we are not producing a deduction, just checking a previous deduction.

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


More information about the cfe-commits mailing list