bug in template template parameters?

Peter Schmid schmid@ltoi.iap.physik.tu-darmstadt.de
Mon Mar 9 10:53:00 GMT 1998


I believe that the following code is legal.
It is from http://www.ocsltd.com/c++/ .
egcs-980308 doesn`t compile the file.
    
Peter Schmid    
 
cat t.C
template<class T> class List;
template<class T> class Vector;
template<class T, template<class U> C = List>
class Group
{
        // ...
        C<T>    container;
};
Group<int>     group_int_list;
Group<int, Vector>      group_int_vector;

g++ -c t.C -W -Wall
t.C:3: parse error before `='
t.C:9: warning: ANSI C++ forbids declaration `Group' with no type
t.C:9: template declaration of `int Group<int>'
t.C:9: parse error before `;'
t.C:10: warning: ANSI C++ forbids declaration `Group' with no type
t.C:10: redefinition of `int Group<int, template <class T> Vector<T>>'
t.C:9: `int Group<int>' previously declared here
t.C:10: template declaration of `int Group<int, template <class T> Vector<T>>'
t.C:10: parse error before `;'





More information about the Gcc-bugs mailing list