This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug in template template parameters?


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 `;'




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]