1 // { dg-do run } 2 // Copyright (C) 1999 Free Software Foundation 3 4 // by Alexandre Oliva <oliva (at) dcc.unicamp.br> 5 6 // based on comp.std.c++ post by Alexander Schiemann <aschiem (at) math.uni-sb.de> 7 8 // execution test 9 10 #include <new> 11 #include <stdlib.h> 12 13 struct A { 14 A() { throw 0; } 15 void* operator new(size_t size, double = 0.0) { return ::operator new(size);} 16 void operator delete(void* p, double) { exit(0); } 17 void operator delete(void* p) { abort(); } 18 }; 19 20 int main() { try { new A; } catch(...) {} } 21