blob: ee6198dfb6cfe9c56f6ce59d2f4c2e6d9666158c [file] [log] [blame]
// { dg-do run }
// It checks to see if you can define your own global new operator.
// prms-id: 755
#include <new>
extern "C" void _exit(int);
void* operator new(std::size_t sz)
#if __cplusplus <= 199711L
throw (std::bad_alloc)
#endif
{
void* p = 0;
_exit(0);
return p;
}
int main () {
int* i = new int;
delete i;
return 1;
}