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]
Other format: [Raw text]

[Bug c++/37112] nested inherited class can't access protected members of base class



------- Comment #1 from chris dot fairles at gmail dot com  2008-08-13 15:32 -------
You're simply trying to access a protected member variable which is not
allowed. It doesn't matter if you try to access it from a member function of a
sub-object of A; if you have an object of type A, and it has a protected member
var i, you cannot access it directly. If foo() took a type C, or only tried to
access "i" (the protected member var of A from which C inherits) as opposed to
a.i, then it will compile as expected.

HTH,

Chris


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37112


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