template class T
class A
{
protected:
int f;
};
template class T
class B: public AT
{
public:
B()
{
f = 1; // line 14
}
};
gcc-3.3 has no problem with this, but gcc-3.4 complains as follows:
a.cc: In constructor `BT::B()':
a.cc:14: error: `f'
This is an intended consequence of the new 3.4 C++ parser. From
http://gcc.gnu.org/gcc-3.4/changes.html
In a template definition, unqualified names will no longer find
members of a dependent base
You need to refer to this-f rather than the unqualified f.
Okay, thanks.
Jay Berkenbilt [EMAIL PROTECTED] writes:
This is an intended consequence of the new 3.4 C++ parser. From
http://gcc.gnu.org/gcc-3.4/changes.html
In a template definition, unqualified names will no longer find
members of a dependent base
You need to refer to this-f rather
Package: gcc-3.4
Version: 3.4.0-2
Severity: important
Tags: experimental
Consider this code fragment:
template class T
class A
{
protected:
int f;
};
template class T
class B: public AT
{
public:
B()
{
f = 1; // line 14
}
};
gcc-3.3 has no problem with this, but
4 matches
Mail list logo