This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2026-02-01


3154. Clarify partial ordering involving variadic templates

Section: 13.10.3.5  [temp.deduct.partial]     Status: open     Submitter: Richard Smith     Date: 2025-01-30

Consider:

  template<typename ...T> void f(T*...);
  template<typename U> void f(U, U);
This ought to be ambiguous, because the analoguous non-variadic case is ambiguous:
  template<typename T1, typename T2> void f(T1*, T2*);
  template<typename U> void f(U, U);

Furthermore, the wording in 13.10.3.5 [temp.deduct.partial] paragraph 8 should use the canonical ordering "P is compared with A" when presenting P vs. A matching.

Suggested resolution:

Change in 13.10.3.5 [temp.deduct.partial] paragraph 8 as follows:

Using the resulting types P and A, the deduction is then done as described in [temp.deduct.type]. If P is a function parameter pack, the type A of each remaining parameter type of the argument template is compared with the type P of the declarator-id of the function parameter pack is compared with the type A of each remaining parameter type of the argument template. Each comparison deduces template arguments for subsequent positions in the template parameter packs expanded by the function parameter pack. Similarly, if A was transformed from a function parameter pack, it is compared with each remaining parameter type of the parameter template is compared with the corresponding expansion of A. If deduction succeeds for a given type, the type from the argument template is considered to be at least as specialized as the type from the parameter template.