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

2025-03-08


2994. Allowing template parameters following template parameter packs that are pack expansions

Section: 13.2  [temp.param]     Status: open     Submitter: Jan Schultke     Date: 2025-01-20

(From submission #666.)

Consider:

  template <class Head, class... Tail>
  struct test {
    template <Tail..., Head>
    static void make() {}       // clang accepts, MSVC rejects
  };

  int main() {
    test<char, int, float>::make<4, 6.f, 'a'>();
  }

There is implementation divergence for the treatment of this example. It ought to be allowed.

Suggested resolution:

Change in 13.2 [temp.param] paragraph 14 as follows:

... If a A template-parameter pack of a function template declares a template parameter pack, it shall not be followed by another template-parameter P unless ...