blob: 5f5c988c29a41f14389aafef16217e7e0fe151cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// GROUPS passed operator-new
#include <stdio.h>
#include <stdlib.h>
#include <new>
int pass = 0;
void *operator new(size_t sz) throw (std::bad_alloc) {
void *p;
pass = 1;
p = malloc(sz);
return p;
}
class A {
public:
A() {}
~A() {}
int a;
int b;
};
int main()
{
A *bb = new A[10];
delete [] bb;
if (pass)
printf ("PASS\n");
else
printf ("FAIL\n");
}
|