This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs 1.0.3 template and typedef bug
- To: egcs-bugs at cygnus dot com
- Subject: egcs 1.0.3 template and typedef bug
- From: Pavlos Papageorgiou <pavlos dot papageorgiou at voxar dot com>
- Date: Thu, 01 Oct 1998 16:24:17 +0100
It seems that egcs-1.0.3 does not support typedefs within classes
that are used as template parameters. It supports enums and other
members but not typedefs.
Sample code, version, and output follow.
===============================
class SimpleTraits {
public:
typedef int Integer;
};
template <class Traits>
class Configurable {
public:
int f () {
Traits::Integer i = 3;
return i;
}
};
int main () {
Configurable<SimpleTraits> c;
return c.f();
}
===============================
g++ --version
egcs-2.90.29 980515 (egcs-1.0.3 release)
===============================
g++ egcs_bug.cpp
egcs_bug.cpp: In method `int Configurable<Traits>::f()':
egcs_bug.cpp:12: parse error before `='
egcs_bug.cpp: In method `int Configurable<SimpleTraits>::f()':
egcs_bug.cpp:13: `i' undeclared (first use this function)
egcs_bug.cpp:13: (Each undeclared identifier is reported only once
egcs_bug.cpp:13: for each function it appears in.)
===============================
Thank you
Pavlos Papageorgiou
Voxar Ltd
pavlos@voxar.com