following minimal reproduce fails with gcc 4.0.1:

template<typename T>
class TVector
{
public:
        T x,y,z,w;
};


template<typename T>
class TQuaternion : public TVector<T>
{
public:
        T Sum()
        {
                return x+y+z+w;
        }
};

the output produced is:

g++ -rdynamic -c -o test.o test.cpp
test.cpp: In member function 'T TQuaternion<T>::Sum()':
test.cpp:15: error: 'x' was not declared in this scope
test.cpp:15: error: 'y' was not declared in this scope
test.cpp:15: error: 'z' was not declared in this scope
test.cpp:15: error: 'w' was not declared in this scope

this should better work. it does e.g. in msvc.

i'm aware of e.g.
http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.0/gcc/Name-lookup.html

requirements as mentioned in the document above clutter the code tremendously.
the complete code that this reproduce bases on also includes complex matrix
operation code, imagine how it looks after its made valid.

i'd be happy if someone could rethink the decisions on this.

-- 
           Summary: gcc cant find base class template members
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gccbugs at paniq dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23496

Reply via email to