OSDN Git Service

Initial revision
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.jason / new3.C
1 // PRMS Id: 6037
2 // Special g++ Options: -fcheck-new
3
4 extern "C" void * malloc (__SIZE_TYPE__);
5
6 struct A {
7   int i;
8   A () { i = 2; }
9 };
10
11 int ena = 0;
12 void * operator new (__SIZE_TYPE__ s)
13 {
14   if (ena)
15     return 0;
16   return malloc (s);
17 }
18
19 main ()
20 {
21   ena = 1;
22   A* ap = new A;
23 }