// PR c++/22147 template struct A; template void foo(A* p) { *p; } template struct A { friend void foo(A*); }; void bar() { foo(0); }