| 1 |
// { dg-do run } |
| 2 |
// { dg-skip-if "requires hosted libstdc++ for stdlib size_t" { ! hostedlib } } |
| 3 |
|
| 4 |
// Copyright (C) 1999 Free Software Foundation |
| 5 |
|
| 6 |
// by Alexandre Oliva <[email protected]> |
| 7 |
|
| 8 |
// based on comp.std.c++ post by Alexander Schiemann <[email protected]> |
| 9 |
|
| 10 |
// execution test |
| 11 |
|
| 12 |
#include <new> |
| 13 |
#include <stdlib.h> |
| 14 |
|
| 15 |
struct A { |
| 16 |
A() { throw 0; } |
| 17 |
void* operator new(size_t size, double = 0.0) { return ::operator new(size);} |
| 18 |
void operator delete(void* p, double) { exit(0); } |
| 19 |
void operator delete(void* p) { abort(); } |
| 20 |
}; |
| 21 |
|
| 22 |
int main() { try { new A; } catch(...) {} } |