| 1 |
void *calloc (__SIZE_TYPE__, __SIZE_TYPE__); |
| 2 |
|
| 3 |
struct B |
| 4 |
{ |
| 5 |
B (short); |
| 6 |
int cls; |
| 7 |
} k (0); |
| 8 |
|
| 9 |
void d (int); |
| 10 |
|
| 11 |
enum e {} i; |
| 12 |
|
| 13 |
struct j |
| 14 |
{ |
| 15 |
void *operator new (__SIZE_TYPE__ b) |
| 16 |
#if __cplusplus >= 201103L |
| 17 |
noexcept |
| 18 |
#else |
| 19 |
throw() |
| 20 |
#endif |
| 21 |
{ |
| 22 |
return calloc (b, sizeof (int)); // { dg-bogus "leak" "" { xfail c++98_only } } |
| 23 |
} |
| 24 |
j (B *, int) |
| 25 |
{ |
| 26 |
} |
| 27 |
}; |
| 28 |
|
| 29 |
j * |
| 30 |
f (B * b, int h, bool) |
| 31 |
{ |
| 32 |
d (b->cls); |
| 33 |
return new j (b, h); // { dg-warning "leak" } |
| 34 |
} |
| 35 |
|
| 36 |
void |
| 37 |
m () |
| 38 |
{ |
| 39 |
if (i) |
| 40 |
f (&k, 0, false); |
| 41 |
} |