This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[repeated] Error accessing protected member
- To: egcs-bugs at cygnus dot com
- Subject: [repeated] Error accessing protected member
- From: Andrey Slepuhin <pooh at msu dot ru>
- Date: Sat, 25 Oct 1997 23:41:30 +0300
- Organization: Moscow State University
- Reply-To: pooh at msu dot ru
Hi,
I didn't get any responce for my previous bug report, so I
repeat it because error remains in 971023 snapshot. Please,
let me know if I'm wrong or if you take control of the situation.
Compiling the following code with egcs-971016 (and egcs-971023):
-----------------------------------------
class A
{
protected:
void f(){}
};
class B :
public A
{
int c;
};
class C :
virtual public B
{
protected:
void f() { A::f(); }
};
void main ()
{
C x;
}
------------------------------
I get the following error message:
------------------------------
tmp.C: In method `void C::f()':
tmp.C:4: `void A::f()' is protected
tmp.C:17: within this context
-------------------------------
(This code is localized from OmniBroker 2.0b4, so it works
fine with most of C++ compilers and gcc-2.7.2 too)
Removing "virtual" all works fine. Virtuality of A->B inheritance
doesn't affect to compilation result.
I didn't find anything in new C++ draft that can explain such effect,
so it seems like egcs bug.
Andrey Slepuhin,
Moscow State University