https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44648
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |5.3.0, 6.3.0, 7.0 --- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> --- Today's trunk warns on three out of the four cases, missing just the 'if (const bool b2 = 1)' conditional. $ cat t.C && gcc -Wall -Wextra -Wpedantic t.C int main() { bool b0 = 1; // { dg-warning "" } const bool b00 = 1; // { dg-warning "" } if (bool b1 = 1) // { dg-warning "" } return 0; else return 1; if (const bool b2 = 1) // { dg-warning "" } return 0; else return 1; } t.C: In function ‘int main()’: t.C:5:12: warning: unused variable ‘b1’ [-Wunused-variable] if (bool b1 = 1) // { dg-warning "" } ^~ t.C:3:8: warning: unused variable ‘b0’ [-Wunused-variable] bool b0 = 1; // { dg-warning "" } ^~ t.C:4:14: warning: unused variable ‘b00’ [-Wunused-variable] const bool b00 = 1; // { dg-warning "" } ^~~