Bug 23496

Summary: gcc cant find base class template members
Product: gcc Reporter: Leonard Ritter <gccbugs>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: normal CC: gcc-bugs
Priority: P2    
Version: 4.1.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Leonard Ritter 2005-08-20 16:35:44 UTC
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.
Comment 1 Andrew Pinski 2005-08-20 18:23:57 UTC
(In reply to comment #0)
> i'd be happy if someone could rethink the decisions on this.

If you can get the standard committe to, then we will.

Other than that, we will not.