GCC 2.95.2 bug with typename and templates
Peter Fraser
pjf@thinkage.ca
Tue Jul 25 11:19:00 GMT 2000
template<class LB> class C
{
public:
typename LB::DataType;
void FillBox(LB::DataType &info);
};
template<class LB> void C<LB>::FillBox(LB::DataType &info)
{
;
}
/*
gives
bug.cpp:8: variable or field `FillBox' declared void
bug.cpp:8: ANSI C++ forbids initialization of member `FillBox'
bug.cpp:8: making `FillBox' static
bug.cpp:8: ANSI C++ forbids in-class initialization of non-const static
member `FillBox'
bug.cpp:12: duplicate initialization of C<LB>::FillBox
bug.cpp:12: conflicting types for `void C<LB>::FillBox'
bug.cpp:8: previous declaration as `int C<LB>::FillBox'
bug.cpp:12: syntax error before `{'
gcc is deciding that "LB::Datatype &info" is an expression
rather that a parameter declaration. gcc is behaving as if
it is ignoring the "typename" declaration.
verion 2.95.2 under Win2000
*/
______________________________________
Peter J Fraser 519 895 1860 x201
President 519 895 1854 fax
Thinkage
85 McIntyre Dr
Kitchener
Ontario N2R 1H6
More information about the Gcc-bugs
mailing list