From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 Description of problem: When compiling the following: template <class type> class SuperClass { protected: type *superClassMember; public: SuperClass(); }; template <class type> SuperClass<type>::SuperClass() { superClassMember = 0; } template <class type> class SubClass : public SuperClass<type> { private: public: SubClass(); }; template <class type> SubClass<type>::SubClass() : SuperClass<type>() { superClassMember = new type[2]; } int main (int, char **) { SubClass<double> *subClass = new SubClass<double>(); delete subClass; } The comiler informs me that superClassMember is not defined: [cet@proteus bug]$ g++ -Wall -W Test.cpp -o Test In file included from Test.cpp:1: SubClass.hpp: In constructor `SubClass<type>::SubClass()': SubClass.hpp:18: error: `superClassMember' undeclared (first use this function) SubClass.hpp:18: error: (Each undeclared identifier is reported only once for each function it appears in.) However if I compile under gcc-c++-3.3.2-1 in Fedora Core 1 it compiles perfectly. Version-Release number of selected component (if applicable): gcc-c++-3.4.2-6.fc3 How reproducible: Always Steps to Reproduce: Attempt to compile the classes given in the description. Additional info:
Please see http://gcc.gnu.org/gcc-3.4/changes.html particularly search for In a template definition, unqualified names will no longer find members of a dependent base. Also, read the ISO C++ 98 standard.