The following code : ====================================== template <typename... T> struct A {}; template <typename T, typename U> struct S {}; template <typename... T, typename... U> A< S<T, U>... > f(U... u) { return A< S<T, U>... >(); } int main() { f<int>(0.0); } ============================================ compiled with g++ -std=c++0x on today's trunk, produces : test_variadic_2.cpp: In function 'int main()': test_variadic_2.cpp:13: error: mismatched argument pack lengths while expanding 'S<T, U>' test_variadic_2.cpp:13: error: no matching function for call to 'f(double)' I believe this is a bug, and the code should be accepted.
Same situation as of today's trunk.
Let's CC Jason...
Subject: Bug 39863 Author: jason Date: Wed Oct 7 18:56:39 2009 New Revision: 152537 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152537 Log: PR c++/39863 * pt.c (tsubst_pack_expansion): Don't do anything now if we have incomplete packs of different lengths. Added: trunk/gcc/testsuite/g++.dg/cpp0x/variadic95.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 39863 Author: jason Date: Wed Oct 7 19:31:56 2009 New Revision: 152538 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152538 Log: PR c++/39863 * pt.c (tsubst_pack_expansion): Don't do anything now if we have incomplete packs of different lengths. PR c++/41038 * tree.c (build_qualified_name): Call convert_from_reference. * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the clones. * decl.c (grok_special_member_properties): Only adjust TYPE_HAS_COMPLEX_* if the function is defaulted in the class body. (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the clones. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/defaulted13.C - copied unchanged from r152373, trunk/gcc/testsuite/g++.dg/cpp0x/defaulted13.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/variadic95.C - copied unchanged from r152537, trunk/gcc/testsuite/g++.dg/cpp0x/variadic95.C branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/scope3.C - copied unchanged from r152537, trunk/gcc/testsuite/g++.dg/template/scope3.C Modified: branches/gcc-4_4-branch/gcc/cp/ChangeLog branches/gcc-4_4-branch/gcc/cp/decl.c branches/gcc-4_4-branch/gcc/cp/pt.c branches/gcc-4_4-branch/gcc/cp/tree.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed for 4.4.2 and 4.5.