Debian Codegraph @

gcc/testsuite/g++.dg/parse/access12.C

raw
1 // Example 2 of [class.access.general]
2 // { dg-do compile }
3
4 class A {
5 typedef int I; // private member
6 I f();
7 friend I g(I);
8 static I x;
9 template<int> struct Q;
10 template<int> friend struct R;
11 protected:
12 struct B { };
13 };
14
15 A::I A::f() { return 0; }
16 A::I g(A::I p = A::x);
17 A::I g(A::I p) { return 0; }
18 A::I A::x = 0;
19 // FIXME: We reject these two declarations because access checking of A::I
20 // is not performed in the scope of the class being declared.
21 // template<A::I> struct A::Q { };
22 // template<A::I> struct R { };
23
24 struct D: A::B, A { };