blob: e257e63125a27f920c22ee2a3f83dd35572751bd [file] [log] [blame]
// PR c++/44648 - missing -Wunused warning on a const variable in if statement
// { dg-do compile }
// { dg-options "-Wunused" }
int main()
{
bool b0 = 1; // { dg-warning "\\\[-Wunused-variable\\\]" }
const bool b00 = 1; // { dg-warning "\\\[-Wunused-variable\\\]" }
if (bool b1 = 1) // { dg-warning "\\\[-Wunused-variable\\\]" }
return 0;
else
return 1;
if (const bool b2 = 1) // { dg-warning "\\\[-Wunused-variable\\\]" }
return 0;
else
return 1;
}