blob: 36c8da5113a8338affd94d6b06cd5845daed20c3 [file] [log] [blame]
/* PR middle-end/104761 - bogus -Wdangling-pointer with cleanup and infinite loop
{ dg-do compile }
{ dg-options "-O -Wall" } */
typedef struct { int i; } S;
void f (S **);
int g (int);
void nowarn (int x)
{
S s = { 0 };
__attribute__((__cleanup__ (f))) S *p = 0;
if (x)
{
g (s.i); // { dg-bogus "-Wdangling-pointer" }
for ( ; ; );
}
}