1 // PR 6764 2 // { dg-do run } 3 // { dg-options "-O -fomit-frame-pointer" } 4 5 extern "C" void abort (); 6 7 class test 8 { 9 public: 10 test * const me; test()11 test () : me(this) { } ~test()12 ~test () { if (me != this) abort (); } 13 }; 14 x1()15void x1 () 16 { 17 test w1; 18 throw 1; 19 } 20 x2()21void x2 () 22 { 23 test w2; 24 x1 (); 25 } 26 main(void)27int main (void) 28 { 29 try { 30 x2 (); 31 } catch (...) { 32 } 33 return 0; 34 } 35