g++ doesn't like template template parameter

Gabriel Dos_Reis Gabriel.Dos_Reis@sophia.inria.fr
Wed Jun 30 04:21:00 GMT 1999


The following compiles fine with egcs-1.1.2 but *not* with current
CVS source :-(

-- Gaby

poivre% cat 1.C
template<typename T> struct A { typedef int X; };

template<typename T, template<class> class C =A>
struct B {
    typedef typename C<T>::X X;
    X x;    

    B(X);
};

template<typename T, template<class> class C>
B<T, C>::B(X n) : x(n) {}

poivre% ~/EGCS/bin/g++ -v; ~/EGCS/bin/g++ 1.C    
Reading specs from /BASE/dosreis/EGCS/lib/gcc-lib/sparc-sun-solaris2.6/gcc-2.96/specs
gcc version gcc-2.96 19990629 (experimental)
1.C:12: `C<T>' is not a class, struct, or union type
1.C:12: syntax error before `:'


More information about the Gcc-bugs mailing list