summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/i-c-e.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-13 19:41:32 +0000
committerChris Lattner <sabre@nondot.org>2010-07-13 19:41:32 +0000
commit8406c5197b7f3315e32db21b637504f33560c6bd (patch)
tree5c472b358c7e223aaf1e99819940a579ee133ec1 /clang/test/Sema/i-c-e.c
parent1e0213a75827425e19ca8f3dfe9604f23fbe3609 (diff)
downloadbcm5719-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/Sema/i-c-e.c')
-rw-r--r--clang/test/Sema/i-c-e.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/Sema/i-c-e.c b/clang/test/Sema/i-c-e.c
index c86a93fed82..eb77bbe3b99 100644
--- a/clang/test/Sema/i-c-e.c
+++ b/clang/test/Sema/i-c-e.c
@@ -51,7 +51,8 @@ char z[__builtin_constant_p(4) ? 1 : -1];
// Comma tests
int comma1[0?1,2:3]; // expected-warning {{expression result unused}}
-int comma2[1||(1,2)]; // expected-warning {{expression result unused}}
+int comma2[1||(1,2)]; // expected-warning {{expression result unused}} \
+ // expected-warning {{use of logical || with constant operand}}
int comma3[(1,2)]; // expected-warning {{size of static array must be an integer constant expression}} \
// expected-warning {{expression result unused}}
OpenPOWER on IntegriCloud