This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[bug] Inheritance and friend access control broken
- To: egcs at cygnus dot com
- Subject: [bug] Inheritance and friend access control broken
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at dptmaths dot ens-cachan dot fr>
- Date: Tue, 3 Mar 1998 22:41:56 +0100 (MET)
protected member field access control seems to be broken in EGCS-980205.
piano% cat toto.C
class B {
protected:
int i;
static int j;
};
class D : public B {
friend void f();
};
void f()
{
B::j = 5;
D::j = 6;
}
piano% g++ -v; g++ -c toto.C
Reading specs from /usr/public/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.07/specs
gcc version egcs-2.91.07 980205 (gcc-2.8.0 release)
toto.C: In function `void f()':
toto.C:13: member `j' is a protected member of class `B'
-- Gaby
"One reason that life is complex is that it has a
real part and imaginary part." -- Andrew Koenig