[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2020-01-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2019-10-02 Thread joerg.rich...@pdv-fs.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 --- Comment #7 from Jörg Richter --- Yes, I changed our code already to if( C != Enum() ) But I still think that an explicit cast should always silence this warning.

[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2019-10-02 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 --- Comment #6 from Bernd Edlinger --- (In reply to Jörg Richter from comment #5) > There needs to be at least a way to suppress the warning with a cast > or some other construct (not pragma). That is simple: if ( C != A ) ...

[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2019-10-02 Thread joerg.rich...@pdv-fs.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 --- Comment #5 from Jörg Richter --- There needs to be at least a way to suppress the warning with a cast or some other construct (not pragma).

[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2019-10-02 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 --- Comment #4 from Jonathan Wakely --- The warning was introduced for PR 77434 and the current behaviour by the fix for PR 77700.

[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2019-10-02 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 Jonathan Wakely changed: What|Removed |Added CC||edlinger at gcc dot gnu.org --- Commen

[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2019-10-02 Thread joerg.rich...@pdv-fs.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 --- Comment #2 from Jörg Richter --- The only boolean context I see is the if(...). The if() is never used with enum constants/types, but only bool-s and int-s. So according to the warning name (int-in-bool-context) the warning can be expected in

[Bug c++/91964] Wrong -Wint-in-bool-context warning for enum constant

2019-10-02 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964 --- Comment #1 from Jonathan Wakely --- (In reply to Jörg Richter from comment #0) > I think all warnings are wrong because nowhere is a enum constant in a > boolean context. The warning is documented as diagnosing "using non-boolean integer con