Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/eh36.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } } |
2 // { dg-options "-fexceptions" } | |
3 | |
4 #include <typeinfo> | |
5 | |
6 class A { | |
7 int space; | |
8 }; | |
9 class B { | |
10 public: | |
11 int data; | |
12 B(int i) : data(i) { | |
13 } | |
14 }; | |
15 class D : public A, public B { | |
16 public: | |
17 D(int i) : B(i) { | |
18 } | |
19 } d(42); | |
20 | |
131 | 21 int |
111 | 22 main() { |
23 try { | |
24 throw &d; | |
25 } catch (B* b) { | |
26 if (b->data == 42) | |
27 return 0; | |
28 } | |
29 return 1; | |
30 } |