1 // From N1791 2 // { dg-do compile { target c++11 } } 3 4 class C; 5 typedef C Ct; 6 class X1 { 7 friend C; // OK: class C is a friend 8 }; 9 10 class X2 11 { 12 friend Ct; // OK: class C is a friend 13 friend D; // { dg-error "" } no type-name D in scope 14 friend class D; // OK: elaborated-type-specifier declares new class 15 }; 16 17 template <typename T> class R { 18 friend T; 19 }; 20 21 R<C> rc; // class C is a friend of R<C> 22 R<int> Ri; // OK: "friend int;" is ignored 23