2 // Test that a throw in B's constructor destroys the A and frees the memory.
23 newed = 0; // The libraries might call new before main starts.
28 return !(!newed && !created);
31 A::A() { created = 1; }
32 A::~A() { created = 0; }
36 void* operator new (size_t size)
37 #if __cplusplus <= 199711L
38 throw (std::bad_alloc)
42 return (void *) std::malloc (size);
45 void operator delete (void *p) throw ()