OSDN Git Service

PR c++/51107
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / friend1.C
1 // From N1791
2 // { dg-options -std=c++0x }
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