diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-13 19:41:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-13 19:41:32 +0000 |
commit | 8406c5197b7f3315e32db21b637504f33560c6bd (patch) | |
tree | 5c472b358c7e223aaf1e99819940a579ee133ec1 /clang/test/SemaCXX/switch.cpp | |
parent | 1e0213a75827425e19ca8f3dfe9604f23fbe3609 (diff) | |
download | bcm5719-llvm-8406c5197b7f3315e32db21b637504f33560c6bd.tar.gz bcm5719-llvm-8406c5197b7f3315e32db21b637504f33560c6bd.zip |
Add a warning to catch a bug recently caught by code review, like this:
t2.c:2:12: warning: use of logical && with constant operand; switch to bitwise &
or remove constant [-Wlogical-bitwise-confusion]
return x && 4;
^ ~
wording improvement suggestions are welcome.
llvm-svn: 108260
Diffstat (limited to 'clang/test/SemaCXX/switch.cpp')
-rw-r--r-- | clang/test/SemaCXX/switch.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/switch.cpp b/clang/test/SemaCXX/switch.cpp index fc13630bbf1..54240dcc305 100644 --- a/clang/test/SemaCXX/switch.cpp +++ b/clang/test/SemaCXX/switch.cpp @@ -8,7 +8,8 @@ void test() { } int n = 3; - switch (n && 1) { // expected-warning {{bool}} + switch (n && 1) { // expected-warning {{bool}} \ + // expected-warning {{use of logical && with constant operand}} case 1: break; } |