Hi,
Can somebody tell me whether there is a known bug in g++ 4.0.1 wrt scoping
of members of a template base class. The following contrived test case
generates a compiler error on 4.0.1, complaining that 'a' is not in the
scope scope of D<T>::f()
template<class C> class T
{
protected:
bool a;
};
template <class C> class D : public T<C>
{
public:
void f(void)
{
a = true;
}
};
int main()
{
D<int> i;
i.f();
return 0;
}
s.cxx: In member function 'void D<T>::f()':
s.cxx:12: error: 'a' was not declared in this scope
This code was accepted just fine on gcc 3.2.3, so could be a new bug, or a
deliberate change to the scoping rules ?
Thanks,
Jon Bloomfield
Architect
3Dlabs UK Ltd
Notice
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.