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