// { dg-do compile } // Origin: Wolfgang Bangerth // PR c++/8099 // Partial specialization as friend class template struct X; template struct X<1,T>; template class Y { static int i; template friend struct X; friend struct X<1,P>; }; template struct X<1,T> { X () { Y::i; } // access private field };