analyzer: add regression test for fixed ICE [PR94028]
The C++ reproducer for PR analyzer/94028 generates a similar ICE to that of the Fortran reproducer for PR analyzer/93993 and, like it, was fixed by r10-7023-g3d66e153b40ed000af30a9e569a05f34d5d576aa. This patch adds the C++ reproducer as a regression test. gcc/testsuite/ChangeLog: PR analyzer/94028 * g++.dg/analyzer/pr94028.C: New test.
This commit is contained in:
parent
3ca63e1c76
commit
4ac3eb5c5f
@ -1,3 +1,8 @@
|
||||
2020-03-04 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
PR analyzer/94028
|
||||
* g++.dg/analyzer/pr94028.C: New test.
|
||||
|
||||
2020-03-04 Martin Sebor <msebor@redhat.com>
|
||||
|
||||
PR middle-end/81401
|
||||
|
36
gcc/testsuite/g++.dg/analyzer/pr94028.C
Normal file
36
gcc/testsuite/g++.dg/analyzer/pr94028.C
Normal file
@ -0,0 +1,36 @@
|
||||
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)
|
||||
{
|
||||
return calloc (b, sizeof (int)); // { dg-warning "leak" }
|
||||
}
|
||||
j (B *, int)
|
||||
{
|
||||
} // { dg-warning "leak" }
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user