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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [cvt10.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed conversions
3
// cvt file
4
// Message-Id: 
5
// From: tom@izfcs.izf.tno.nl (Tom Vijlbrief)
6
// Subject: g++ 2.4.5 has problems with NON virtual shared base classes
7
// Date: Mon, 23 Aug 1993 12:10:34 GMT
8
 
9
 
10
#include        
11
 
12
#define FAIL
13
 
14
class Base {
15
public:
16
  Base() { printf("Base::Base\n"); }
17
  virtual ~Base() { printf("Base::~Base\n"); }
18
  virtual void v() { printf("Base::v\n"); }
19
};
20
 
21
class Base2 {
22
public:
23
  Base2() { printf("Base2::Base2\n"); }
24
  virtual ~Base2() { printf("Base2::~Base2\n"); }
25
  virtual void v() { printf("Base2::v\n"); }
26
};
27
 
28
class A: public Base {
29
public:
30
  A() { printf("A::A\n"); }
31
  ~A() { printf("A::~A\n"); }
32
  virtual void va() { printf("A::va\n"); }
33
};
34
 
35
#ifdef FAIL
36
class B: public Base {
37
#else
38
class B: public Base2 {
39
#endif
40
public:
41
  B() { printf("B::B\n"); }
42
  ~B() { printf("B::~B\n"); }
43
  virtual void vb() { printf("B::vb\n"); }
44
};
45
 
46
class C: public A, public B {
47
public:
48
  C() { printf("C::C\n"); }
49
  ~C() { printf("C::~C\n"); }
50
  void va() { printf("C::va\n"); }
51
};
52
 
53
 
54
int main()
55
{
56
  C *cp= new C;
57
  cp->va();
58
  delete cp;
59
}
60
 

powered by: WebSVN 2.1.0

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