Automatic date update in version.in
[binutils-gdb/blckswan.git] / gdb / testsuite / gdb.cp / casts.cc
blobf64d13c26dff4c5958684f4145be7ff5be0c8404
1 #include <cstdint>
3 struct A
5 int a;
6 A (int aa): a (aa) {}
7 };
9 struct B: public A
11 int b;
12 B (int aa, int bb): A (aa), b(bb) {}
16 struct Alpha
18 virtual void x() { }
21 struct Gamma
25 struct Derived : public Alpha
29 struct VirtuallyDerived : public virtual Alpha
33 struct DoublyDerived : public VirtuallyDerived,
34 public virtual Alpha,
35 public Gamma
39 struct Left
41 int left;
44 struct Right
46 int right;
49 struct LeftRight : public Left, public Right
53 int
54 main (int argc, char **argv)
56 A *a = new B(42, 1729);
57 B *b = (B *) a;
58 A &ar = *b;
59 B &br = (B&)ar;
61 Derived derived;
62 DoublyDerived doublyderived;
64 Alpha *ad = &derived;
65 Alpha *add = &doublyderived;
67 LeftRight gd;
68 gd.left = 23;
69 gd.right = 27;
70 unsigned long long gd_value = (unsigned long long) (std::uintptr_t)&gd;
71 unsigned long long r_value = (unsigned long long) (Right *) &gd;
73 return 0; /* breakpoint spot: casts.exp: 1 */