You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After CWG 1873, derived class friends have no access to base class protected members. The example in [class.protected], however, still labels such accesses as OK:
class B {
protected:
int i;
static int j;
};
class D1 : public B {
};
class D2 : public B {
friend void fr(B*,D1*,D2*);
void mem(B*,D1*);
};
void fr(B* pb, D1* p1, D2* p2) {
// snip
B::j = 5; // OK (because refers to static member)
D2::j = 6; // OK (because refers to static member)
}
The line B::j = 5; should be marked ill-formed instead.
The text was updated successfully, but these errors were encountered:
After CWG 1873, derived class friends have no access to base class protected members. The example in [class.protected], however, still labels such accesses as OK:
The line
B::j = 5;
should be marked ill-formed instead.The text was updated successfully, but these errors were encountered: