Bug 23496 - gcc cant find base class template members
Summary: gcc cant find base class template members
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-20 16:35 UTC by Leonard Ritter
Modified: 2005-08-20 18:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.