http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52844
Markus Trippelsdorf <markus at trippelsdorf dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |markus at trippelsdorf dot | |de --- Comment #3 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-10-12 15:47:20 UTC --- As Dave said the testcase is invalid: Creduce comes up with: markus@x4 tmp % cat test.ii namespace std { typedef int size_t; template<typename>struct A; } struct B {}; template<class T, T ...>struct vector_c { typedef vector_c type; }; template<class T, T, T>struct range_c : B {}; template<class T, T start_finish>struct range_c<T, start_finish, start_finish>: vector_c<T> {}; namespace std { template<typename ...>class tuple; template<typename ... _Elements>tuple<typename A< _Elements>::__type ...>make_tuple(); template<typename F, typename ... T, std::size_t ... Is> auto apply_tuple_(F, std::tuple<T ...>, vector_c<Is ...>)->decltype(0); template<typename F, typename ... T> auto apply_tuple(F, std::tuple<T ...>t) -> decltype(apply_tuple_ (0, t, typename range_c<std::size_t, 0, sizeof ... (T)>::type())); int x = apply_tuple(0, std::make_tuple); } markus@x4 tmp % g++ -std=c++11 -c test.ii test.ii: In substitution of ‘template<class F, class ... T> decltype (std::apply_tuple_(0, t, typename range_c<int, 0, sizeof (T ...)>::type())) std::apply_tuple(F, std::tuple<T ...>) [with F = int; T = {}]’: test.ii:27:39: required from here test.ii:26:51: internal compiler error: in unify_one_argument, at cp/pt.c:15162 sizeof ... (T)>::type())); ^ Please submit a full bug report, markus@x4 tmp % clang++ -std=c++11 -c test.ii test.ii:22:30: error: template argument for template type parameter must be a type vector_c<Is ...>)->decltype(0); ^~~~~~ test.ii:7:16: note: template parameter is declared here template<class T, T ...>struct vector_c ^ test.ii:27:9: error: no matching function for call to 'apply_tuple' int x = apply_tuple(0, std::make_tuple); ^~~~~~~~~~~ test.ii:24:8: note: candidate template ignored: substitution failure [with F = int, T = <>]: no matching function for call to 'apply_tuple_' auto apply_tuple(F, std::tuple<T ...>t) ^ 2 errors generated. markus@x4 tmp % icpc -std=c++11 test.ii test.ii(2): warning #910: declaration of "size_t" does not match the expected type "unsigned long" typedef int size_t; ^ test.ii(22): error: constant "Is" is not a type name vector_c<Is ...>)->decltype(0); ^ test.ii(22): error: pack expansion does not make use of any argument packs vector_c<Is ...>)->decltype(0); ^ test.ii(20): warning #2922: constant "Is" cannot be used because it follows a parameter pack and cannot be deduced from the parameters of function template "std::apply_tuple_" template<typename F, typename ... T, std::size_t ... Is> ^ test.ii(27): error: no instance of function template "std::apply_tuple" matches the argument list argument types are: (int, <unknown-type>) int x = apply_tuple(0, std::make_tuple); ^ compilation aborted for test.ii (code 2)