Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.mike/eh37.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 B { | |
7 public: | |
8 int data; | |
9 B(int i) : data(i) { | |
10 } | |
11 } b(42); | |
12 | |
131 | 13 int |
111 | 14 main() { |
15 try { | |
16 throw &b; | |
17 } catch (B* b) { | |
18 if (b->data == 42) | |
19 return 0; | |
20 } | |
21 return 1; | |
22 } |