Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.mike/eh37.C

raw
1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions" }
3
4 #include <typeinfo>
5
6 class B {
7 public:
8 int data;
9 B(int i) : data(i) {
10 }
11 } b(42);
12
13 int
14 main() {
15 try {
16 throw &b;
17 } catch (B* b) {
18 if (b->data == 42)
19 return 0;
20 }
21 return 1;
22 }