1 // { dg-do assemble  }
2 // GROUPS passed visibility
3 // visibility file
4 // From: Marie Trapp <Marie.Trapp@analog.com>
5 // Date:     Thu, 5 Aug 93 11:55:15 EDT
6 // Subject:  access of protected members
7 // Message-ID: <9308051553.AA07639@nwd2sun1.analog.com>
8 class A {
9   protected:
10     int astuff; // { dg-message "" } protected
A()11     A() {
12         astuff = 3;
13     }
14 };
15 
16 class B : public A {
17     int bstuff;
18   public:
B(A * p)19     B( A *p) {
20         bstuff = p->astuff;// { dg-error "" } .*
21     }
22 };
23 
24 class C : public A {
25     int cstuff;
26   public:
C()27     C() {
28         cstuff = 5;
29     }
30 };
31 
main()32 int main() {
33     C cvar;
34     B bvar(&cvar);
35 }
36