1 // Bug: We were calling f() twice, for both the placement new and placement 2 // delete calls. 3 4 // { dg-do run } 5 6 void* operator new (__SIZE_TYPE__ sz, void*) { return operator new (sz); } 7 void operator delete (void* p, void*) { operator delete (p); } 8 9 struct A { A() { throw 1; } }; 10 11 int c; 12 void *f() { ++c; return 0; } 13 14 int main() 15 { 16 try 17 { 18 new (f()) A; 19 } 20 catch (...) {} 21 return c != 1; 22 } 23