// { dg-do compile { target c++11 } } template struct A { void foo(); }; struct B { template friend void A::A::foo(); // { dg-error "declared as friend" } };