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]

egcs 1.0.3 template and typedef bug


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


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