Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wdangling-pointer-4.C

raw
1 /* PR middle-end/104761 - bogus -Wdangling-pointer with cleanup and infinite loop
2 { dg-do compile }
3 { dg-options "-O -Wall -fno-exceptions" } */
4
5 struct S { int i; };
6
7 struct X { ~X (); };
8
9 void g (int);
10
11 void test (int i)
12 {
13 S s = { 0 };
14
15 X x;
16
17 if (i)
18 {
19 g (s.i); // { dg-bogus "-Wdangling-pointer" }
20 for ( ; ; );
21 }
22 }