g++ incorrectly accepts the following code that contains a non-deductible template parameter pack: #include <utility> template<std::size_t ...Ns, typename ...Ts> void foo(std::index_sequence<Ns...>) { } int main() { foo(std::make_index_sequence<5>{}); } ISO14882:2014 states the following in [temp.param]: (9) [...] A default template-argument may be specified for any kind of template-parameter (type, non-type, template) that is not a template parameter pack (14.5.3). [...] (11) [...] A template parameter pack of a function template shall not be followed by another template parameter unless that template parameter can be deduced from the parameter-type-list of the function template or has a default argument (14.8.2). It also gives an example similar to the above. As far as I can tell, it is neither possible to deduce nor to specify the types for 'Ts' and thus this template function should be rejected. The example code was compiled with the following command line invocation: g++ -Wall -Wextra -pedantic -pedantic-errors -Werror -std=c++14 templ.cpp
clang, ICC and GCC all accept it. ICC warns though: <source>(4): warning #2922: template parameter "Ts" cannot be used because it follows a parameter pack and cannot be deduced from the parameters of function template "foo" template<std::size_t ...Ns, typename ...Ts> ^ And MSVC errors out: <source>(5): error C3547: template parameter 'Ts' cannot be used because it follows a template parameter pack and cannot be deduced from the function parameters of 'foo'