Consider this piece of code: template < typename T > class Alloc { }; template < typename T, typename A = Alloc< T > > class List { }; template < template < typename > class > class container; typedef container< List > myotherlist;
This code compiles fine with gcc-3.x, gcc-4.0 and gcc-4.1 but with gcc-4.2.0 20060415 I get an "type/value mismatch at argument 1 in template parameter list for 'template<template<class> class<template-parameter-1-1> > struct container expected a template of type 'template<class> class<template-parameter-1-1>', got 'template<class T, class A> class List'" error. Changing the forward declaration of template class container makes it work: template < template < typename, typename > class > class container; This makes the default in the template type list of class List slightly pointless. -- Summary: Failure to recognize template default type argument Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kreckel at ginac dot de GCC build triplet: i686-linux-gnu GCC host triplet: i686-linux-gnu GCC target triplet: i686-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27178