summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/uninit-pred-loop-1_a.cc
blob: 835cdbae320a97a3d9541c8598681757ce59c223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-Wuninitialized -O2" } */

extern int bar();
int foo(void)
{
 for (;;) {
   int err = ({int _err; /*  { dg-bogus "uninitialized" "false warning" } */
     for (int i = 0; i < 16; ++i) {
       _err = 17;
       _err = bar();
     }
     _err; /*  { dg-bogus "uninitialized" "false warning" } */
   });

   if (err == 0) return 17; 
 }

 return 18;
}