static void f(); class A { private: int m_; friend void f(); }; static void f() { A a; a.m_ = 4; }