Created attachment 26752 [details] Output of -v option and preprocessed file Here is a reproducer; /////////////////////////////////////////////// // An enclosing class template is necessary to // reproduce the bug. template<typename T> struct S { template<typename U> struct Unary // Line 5 {}; template<unsigned, typename... Args> struct Dispatch // Line 9 : public Unary<Args...> {}; template<typename... Args> struct Variadic : public Dispatch<sizeof...(Args), Args...> {}; }; int main() { S<void>::Variadic<void> z; } /////////////////////////////////////////////// GCC 4.7.0 20120218 (experimental) with -std=c++11 complains about the above code; main.cpp: In instantiation of 'struct S<void>::Dispatch<1u, void>': main.cpp:14:10: required from 'struct S<void>::Variadic<void>' main.cpp:21:27: required from here main.cpp:9:10: error: wrong number of template arguments (2, should be 1) main.cpp:5:10: error: provided for 'template<class T> template<class U> struct S<T>::Unary' Obviously, just one template argument is passed to `Unary'. However, GCC misinterprets the number of template arguments as two.
Author: jason Date: Mon Apr 16 03:18:06 2012 New Revision: 186479 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186479 Log: PR c++/52292 PR c++/52380 * pt.c (coerce_template_parms): Even if we aren't converting we want to expand argument packs. Added: trunk/gcc/testsuite/g++.dg/cpp0x/variadic124.C trunk/gcc/testsuite/g++.dg/cpp0x/variadic125.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Author: jason Date: Mon Apr 16 03:40:34 2012 New Revision: 186481 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186481 Log: PR c++/52292 PR c++/52380 * pt.c (coerce_template_parms): Even if we aren't converting we want to expand argument packs. Added: branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/variadic124.C branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/variadic125.C Modified: branches/gcc-4_7-branch/gcc/cp/ChangeLog branches/gcc-4_7-branch/gcc/cp/pt.c branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Fixed for 4.7.1.