This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Weird "protected within this context"


EGCS release 1.0 cannot compile following code:

class A {
protected:
	int f(int);
};

class B: public A {
};

class C: virtual public B {
public:
	int f(int x);
};

int C::f(int x){
	return A::f(x+4)+5;
}


It give this message:

q.cc: In method `int C::f(int)':
q.cc:3: `int A::f(int)' is protected
q.cc:15: within this context

GCC 2.7.2.1 give same error.  "Any other C++ compiler in the world" can 
compile such code... And I don't understand what can be wrong with this 
example.

Thanks.
Dima




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]