blob: 0573d309ba25e95d8dbf3156694014ca9c35f42f [file] [log] [blame]
void *calloc (__SIZE_TYPE__, __SIZE_TYPE__);
struct B
{
B (short);
int cls;
} k (0);
void d (int);
enum e {} i;
struct j
{
void *operator new (__SIZE_TYPE__ b)
#if __cplusplus >= 201103L
noexcept
#else
throw()
#endif
{
return calloc (b, sizeof (int)); // { dg-bogus "leak" "" { xfail c++98_only } }
}
j (B *, int)
{
}
};
j *
f (B * b, int h, bool)
{
d (b->cls);
return new j (b, h); // { dg-warning "leak" }
}
void
m ()
{
if (i)
f (&k, 0, false);
}