1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// { dg-do assemble } // GROUPS passed visibility class foo { protected: int i; // { dg-error "" } protected }; class bar : public foo { public: friend void baz (foo *); }; void baz (foo *f) { f->i = 1; // error: i is protected// { dg-error "" } .* }