This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115a. See for the official list.


1399. Deduction with multiple function parameter packs

Section:  []     Status: CD3     Submitter: Jason Merrill     Date: 2011-09-29

[Moved to DR at the October, 2012 meeting.]


    template <class... T>
    void f(T..., int, T...) { }

    int main() {
       f(0);          // OK
       f<int>(0,0,0); // OK
       f(0,0,0);      // error

It seems clear that the third call is ill-formed because by the time we get to the second function parameter pack we've already assumed that T is empty, so deducing anything for T would be nonsensical. But I don't think this is expressed anywhere in the standard.

One way to handle this would be to say that a template parameter pack is not deducible if it is used in a function parameter pack not at the end of the parameter list.

Proposed resolution (February, 2012):

This issue is resolved by the resolution of issue 1388.