class X { private: int i; friend void f(X*); }; void f(X* x) { x->i = 42; } void g(X* x) { x->i = 23; } // Fehler!