Debian Codegraph @

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

raw
1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions" }
3
4 int count;
5
6 class Foo {
7 public:
8 Foo() { ++count; }
9 Foo(const Foo&) { ++count; }
10 ~Foo() { --count; }
11 };
12
13
14 int
15 main() {
16 try {
17 throw Foo();
18 }
19 catch (Foo& object) {
20 if (count == 1)
21 return 0;
22 }
23 return 1;
24 }