The following code fails (worked with gcc 4.1.2) template<typename T> struct trait { static const int level = 0; };
template<typename T> struct A { struct B { typedef T datatype; datatype *data; B *next; }; B* LIST; }; template<typename T> struct trait< A<T> > { static const int level = 1+trait<T>::level; }; // the definition that causes trouble template<typename T> struct trait<typename A<T>::B > { static const int level = 1+trait< A<T> >::level; }; with Error message: error: template parameters not used in partial specialization: error: T This is similar to bug 35989, but simpler, as it does not involve std::vector. -- Summary: code rejected in template specialization Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: wd11 at astro dot le dot ac dot uk GCC host triplet: x86_64-suse-linux GCC target triplet: x86_64-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37459