blob: 599d9bfe3c7cbd687e10eec56e4ede325044e66d [file] [log] [blame]
/* PR middle-end/104232 - spurious -Wuse-after-free after conditional free
{ dg-do compile }
{ dg-options "-O2 -Wall" } */
char* f (void);
struct A
{
char *p;
A (): p () { }
~A ()
{
__builtin_free (p); // { dg-bogus "-Wuse-after-free" }
}
};
int test_no_warn (void)
{
A px, qx;
qx.p = f ();
if (!qx.p)
return 0;
px.p = f ();
return 1;
}