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