// PR c++/31132 template class A { static int i; // { dg-error "is private" } friend int T::foo(); // { dg-error "does not match" } }; struct B { void foo() { A::i; } // { dg-error "within|candidate" } };