summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/access5.C
blob: 80f848c1ded3d44cbb76323a7ff541362b3b8e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// { dg-do assemble  }
// GROUPS passed access
// access file
// From: Jeffrey C. Gealow <jgealow@mtl.mit.edu>
// Date:     Thu, 18 Feb 93 10:22:23 -0500
// Subject:  nested class access control bug
// Message-ID: <9302181522.AA29209@mtl.mit.edu>


class enclose {
public:
  class nested_public { int x; };
protected:
  class nested_protected { int x; };
private:
  class nested_private { int x; }; // { dg-error "" } private
};

class derived : public enclose {
  nested_public obj1;     // ok
  nested_protected obj2;  // ok
  nested_private obj3;    // error// { dg-error "" } in this context
};