Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/warn/Wunused-var-35.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // PR c++/44648 - missing -Wunused warning on a const variable in if statement | |
2 // { dg-do compile } | |
3 // { dg-options "-Wunused" } | |
4 | |
5 int main() | |
6 { | |
7 bool b0 = 1; // { dg-warning "\\\[-Wunused-variable\\\]" } | |
8 const bool b00 = 1; // { dg-warning "\\\[-Wunused-variable\\\]" } | |
9 if (bool b1 = 1) // { dg-warning "\\\[-Wunused-variable\\\]" } | |
10 return 0; | |
11 else | |
12 return 1; | |
13 | |
14 if (const bool b2 = 1) // { dg-warning "\\\[-Wunused-variable\\\]" } | |
15 return 0; | |
16 else | |
17 return 1; | |
18 } |