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.
--
Summary: Compiling error with variadic template with fixed
parameter with default type.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rodolfo at rodsoft dot org
GCC build triplet: *-*-*-*
GCC host triplet: *-*-*-*
GCC target triplet: *-*-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35297