[PATCH] D63082: [Diagnostics] Added support for -Wint-in-bool-context
Dávid Bolvanský via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 28 10:10:13 PDT 2019
xbolva00 marked an inline comment as done.
xbolva00 added inline comments.
================
Comment at: test/SemaCXX/warn-int-in-bool-context.cpp:99
+
+ if (ans == yes || no) // expected-warning {{enum constant in boolean context}}
+ return a;
----------------
aaron.ballman wrote:
> Why do we want to diagnose this case in C++ but not in C?
I think we can and should but for unknown reason (for me) this is GCC’s behaviour.
Maybe it is too noisy for C codebases?
Maybe introduce -Wenum-in-bool-context as subgroup of -Wint-in-bool-context? And enable it for C and C++?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63082/new/
https://reviews.llvm.org/D63082
More information about the cfe-commits
mailing list