OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bob/] [protected1.C] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
class A {
3
public:
4
  int i;
5
  A(int j) : i(j){}
6
};
7
 
8
class B : protected A {
9
public:
10
  B(int j) : A(j){}
11
  void f(){
12
    A k(*this);
13
  }
14
};
15
 
16
class C : protected B {
17
public:
18
  C(int j) : B(j){}
19
  void f();
20
 
21
  void g(){
22
    A k(i);
23
  }
24
};
25
 
26
 
27
class D : public C {
28
public:
29
   D(int w) : C(i) {}
30
   void j() { A k(*this); }
31
   void h() { i=3; }
32
};
33
 
34
void C::f() {
35
   A k(*this);
36
}
37
 
38
B b(3);
39
int
40
main() {
41
 A *z = &b; // { dg-error "" }
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.