summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p755.C
blob: 28eeefad43dfcd79e8d963081f88a8d2981effa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { 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) throw (std::bad_alloc) {
  void* p = 0;
  _exit(0);
  return p;
}

int main () {
  int* i = new int;
  delete i;
  return 1;
}