blob: 7177a545970c4be2a76dca362c3bfd03c777d1b2 [file] [log] [blame]
/* PR middle-end/104761 - bogus -Wdangling-pointer with cleanup and infinite loop
{ dg-do compile }
{ dg-options "-O -Wall -fno-exceptions" } */
struct S { int i; };
struct X { ~X (); };
void g (int);
void test (int i)
{
S s = { 0 };
X x;
if (i)
{
g (s.i); // { dg-bogus "-Wdangling-pointer" }
for ( ; ; );
}
}