The following C++ code is rejected by GCC 8.0.1 20180313 (tested with https://godbolt.org/): /************* SOURCE *************/ template<typename... T> struct S { template<T... xs> static int f() { return 0; } }; int t = S<int, int>::f<0, 0>(); /*********** END SOURCE ***********/ /************* OUTPUT *************/ <source>:9:30: error: no matching function for call to 'S<int, int>::f<0, 0>()' int t = S<int, int>::f<0, 0>(); ^ <source>:4:16: note: candidate: 'template<T ...xs> static int S<T>::f() [with T ...xs = {xs ...}; T = {int, int}]' static int f() { ^ <source>:4:16: note: template argument deduction/substitution failed: <source>:9:30: error: wrong number of template arguments (2, should be 1) int t = S<int, int>::f<0, 0>(); ^ Compiler returned: 1 /*********** END OUTPUT ***********/ I believe this code is correct and should be accepted.
Doesn't seem to be ever accepted, not a regression.
Note if you do (instead of the last line): int t = S<int, int>::f<0>(); On the trunk we produce an ICE: <source>:9:26: internal compiler error: tree check: accessed elt 1 of 'tree_vec' with 0 elts in tsubst_pack_expansion, at cp/pt.c:13047 9 | int t = S<int, int>::f<0>(); | ~~~~~~~~~~~~~~~~~^~
(In reply to Andrew Pinski from comment #2) > Note if you do (instead of the last line): That would make it related to PR 84796.