FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bob / protected1.C
blob95a400eeaa1ad5adaf30130f6a3f4a202e9c6749
1 // Build don't link: 
2 class A {
3 public:
4   int i;
5   A(int j) : i(j){}
6 };
8 class B : protected A {
9 public:
10   B(int j) : A(j){}
11   void f(){
12     A k(*this);
13   }
16 class C : protected B {
17 public:
18   C(int j) : B(j){}
19   void f();
21   void g(){
22     A k(i); 
23   }
27 class D : public C {
28 public:
29    D(int w) : C(i) {}
30    void j() { A k(*this); }
31    void h() { i=3; }
34 void C::f() {
35    A k(*this);
38 B b(3);
39 int
40 main() {
41  A *z = &b; // ERROR -