// { dg-do compile } // Origin: Wolfgang Bangerth // PR c++/9453 // Access checking when template friend is defined in class. template class X { private: struct Inner; template friend typename X::Inner * foo (X*) { return 0; } }; template class X; X* p; struct U { void bar () { foo (p); } };