Hi, the following code fails to compile with gcc-4.3-20080215 template <class T=int, class... ARGS> struct test {}; int main() { test<> a; return 0; } According to N2242 section 3.6, page 7: If a template-parameter of a class template has a default template-argument, each subsequent template-parameter shall either have a default template-argument supplied or be a template parameter pack. If a template-parameter of a class template is a template parameter pack, it must be the last template-parameter. The compiler issues the following error: no default argument for ‘ARGS’ at line 1 above.
Confirmed.
Subject: Bug 35297 Author: jason Date: Wed Jan 7 20:43:01 2009 New Revision: 143166 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143166 Log: PR c++/35297 PR c++/35477 PR c++/35784 PR c++/36846 PR c++/38276 * pt.c (check_default_tmpl_args): Don't complain about out-of-order parameter packs in the enclosing class or parameter packs after default args. (coerce_template_parms): If we have more than one parameter pack, don't flatten argument packs. (template_args_equal): Handle argument packs. (comp_template_args): Don't flatten argument packs. (check_instantiated_arg): Split out from... (check_instantiated_args): Here. Handle arg packs. (convert_template_argument): Just check that nontype argument packs have the right type. Added: trunk/gcc/testsuite/g++.dg/cpp0x/variadic92.C trunk/gcc/testsuite/g++.dg/cpp0x/variadic93.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/cpp0x/variadic65.C trunk/gcc/testsuite/g++.dg/cpp0x/variadic82.C trunk/gcc/testsuite/g++.dg/cpp0x/variadic83.C
Fixed.