1 // { dg-do assemble }
2 // Test that access control for types and statics works properly
3 // with nested types.
4
5
6 class A {
7 static int I1; // { dg-error "" } private
8 struct B1 { }; // { dg-error "" } private
9 public:
10 static int I2;
11 struct B2 { };
12 };
13
14 class D: public A {
15 struct E {
16 void f ();
17 };
18 };
19
f()20 void D::E::f ()
21 {
22 int i = I1; // { dg-error "" } within this context
23 B1 b1; // { dg-error "" } within this context
24 i = I2;
25 B2 b2;
26 }
27
f()28 void f ()
29 {
30 A::B1 b1; // { dg-error "" } within this context
31 new A::B1; // { dg-error "" } within this context
32 (A::B1) b1; // { dg-error "" } within this context
33 }
34