// PR c++/16617 class B { protected: int i; }; template void fr (); class D2 : public B { friend void fr (); }; template struct X {}; template void fr () { X<&B::i> x1; // { dg-error "protected" } X<&D2::i> x2; // { dg-error "protected" } } template void fr();