2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / access7.C
blob635c6df77fa128a08b5f10cbe50fb79e097b572c
1 // { dg-do assemble  }
2 // Test that access control for types and statics works properly
3 // with nested types.
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 { };
14 class D: public A {
15   struct E {
16     void f ();
17   };
20 void D::E::f ()
22   int i = I1;                   // { dg-error "" } within this context
23   B1 b1;                        // { dg-error "" } within this context
24   i = I2;
25   B2 b2;
28 void f ()
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