Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/warn/Wduplicated-cond1.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // PR c++/94265 | |
2 // { dg-do compile { target c++17 } } | |
3 // { dg-additional-options "-Wduplicated-cond" } | |
4 | |
5 void | |
6 foo () | |
7 { | |
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 { } | |
16 } |