Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wduplicated-cond1.C
blobe85920aaedf3452ea85152224751714559e42501
1 // PR c++/94265
2 // { dg-do compile { target c++17 } }
3 // { dg-additional-options "-Wduplicated-cond" }
5 void
6 foo ()
8   if (int a = 0; a)
9   { }
10   else if (a = 5; a) // { dg-message "previously used here" }
11   { }
12   else if (; a) // { dg-warning "duplicated .if. condition" }
13   { }
14   else if (int b = ++a; a)
15   { }