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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.cp/] [casts.cc] - Blame information for rev 330

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
struct A
2
{
3
  int a;
4
  A (int aa): a (aa) {}
5
};
6
 
7
struct B: public A
8
{
9
  int b;
10
  B (int aa, int bb): A (aa), b(bb) {}
11
};
12
 
13
 
14
struct Alpha
15
{
16
  virtual void x() { }
17
};
18
 
19
struct Gamma
20
{
21
};
22
 
23
struct Derived : public Alpha
24
{
25
};
26
 
27
struct VirtuallyDerived : public virtual Alpha
28
{
29
};
30
 
31
struct DoublyDerived : public VirtuallyDerived,
32
                       public virtual Alpha,
33
                       public Gamma
34
{
35
};
36
 
37
int
38
main (int argc, char **argv)
39
{
40
  A *a = new B(42, 1729);
41
  B *b = (B *) a;
42
  A &ar = *b;
43
  B &br = (B&)ar;
44
 
45
  Derived derived;
46
  DoublyDerived doublyderived;
47
 
48
  Alpha *ad = &derived;
49
  Alpha *add = &doublyderived;
50
 
51
  return 0;  /* breakpoint spot: casts.exp: 1 */
52
}

powered by: WebSVN 2.1.0

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