This is the mail archive of the gcc@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]

[bug] Inheritance and friend access control broken



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


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