2 // Test that a throw in foo destroys the A, but does not free the memory.
3 // Avoid use of none-overridable new/delete operators in shared
4 // { dg-options "-static" { target *-*-mingw* } }
5 // { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } }
30 return !(newed && !created);
33 A::A() { created = 1; }
34 A::~A() { created = 0; }
36 void foo (B*) { throw 1; }
38 void* operator new (size_t size)
39 #if __cplusplus <= 199711L
40 throw (std::bad_alloc)
44 return (void *) std::malloc (size);
47 void operator delete (void *p) throw ()