[PATCH] D63082: [Diagnostics] Added support for -Wint-in-bool-context
Dávid Bolvanský via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 29 11:31:45 PDT 2019
xbolva00 marked an inline comment as done.
xbolva00 added inline comments.
================
Comment at: test/SemaCXX/warn-int-in-bool-context.cpp:96
+
+ if (f == apple || orange) // expected-warning {{enum constant in boolean context}}
+ return a;
----------------
@aaron.ballman : In C (but not in C++ ugh?) mode we have: 'use of logical '||' with constant operand' here..
/home/xbolva00/LLVM/llvm/tools/clang/test/SemaCXX/warn-int-in-bool-context.cpp:106:18: warning: use of logical '||' with constant operand
if (f == apple || orange) // expected-warning {{enum constant in boolean context}}
^ ~~~~~~
/home/xbolva00/LLVM/llvm/tools/clang/test/SemaCXX/warn-int-in-bool-context.cpp:106:18: note: use '|' for a bitwise operation
if (f == apple || orange) // expected-warning {{enum constant in boolean context}}
^~
|
/home/xbolva00/LLVM/llvm/tools/clang/test/SemaCXX/warn-int-in-bool-context.cpp:106:21: warning: enum constant in boolean context
if (f == apple || orange) // expected-warning {{enum constant in boolean context}}
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63082/new/
https://reviews.llvm.org/D63082
More information about the cfe-commits
mailing list