summaryrefslogtreecommitdiff
path: root/test/SemaCXX/bool.cpp
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
commit90a8f27f144233b53cac0c88a1595f7f05105b7e (patch)
treea3ef6406b2b4ac33704047c7ae3a8188a7200640 /test/SemaCXX/bool.cpp
parent3d4b482b5f2cacc7686f65bb231ad666a5adad4a (diff)
downloadclang-90a8f27f144233b53cac0c88a1595f7f05105b7e.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/bool.cpp')
-rw-r--r--test/SemaCXX/bool.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SemaCXX/bool.cpp b/test/SemaCXX/bool.cpp
index 44e17ce62b..726fa6cb60 100644
--- a/test/SemaCXX/bool.cpp
+++ b/test/SemaCXX/bool.cpp
@@ -25,6 +25,6 @@ void static_assert_arg_is_bool(T x) {
void test2() {
int n = 2;
- static_assert_arg_is_bool(n && 4);
- static_assert_arg_is_bool(n || 5);
+ static_assert_arg_is_bool(n && 4); // expected-warning {{use of logical && with constant operand}}
+ static_assert_arg_is_bool(n || 5); // expected-warning {{use of logical || with constant operand}}
}