This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
GCC 2.95.2 bug with typename and templates
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: GCC 2.95.2 bug with typename and templates
- From: Peter Fraser <pjf at thinkage dot ca>
- Date: Tue, 25 Jul 2000 14:19:17 -0400
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