diff options
author | David Bolvansky <david.bolvansky@gmail.com> | 2019-10-04 12:55:13 +0000 |
---|---|---|
committer | David Bolvansky <david.bolvansky@gmail.com> | 2019-10-04 12:55:13 +0000 |
commit | 5429a2e9a37c454109be174b57dbc6d0511b91f2 (patch) | |
tree | 0d84d2c9df0fb6137cb2d8fc34d020bc0c315c7f /test/Sema | |
parent | 8ccf219e3bed92f13f16e411a7e42b32fe85a1bc (diff) |
[NFCI] Improve the -Wbool-operation's warning message
Based on the request from the post commit review. Also added one new test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/warn-bitwise-negation-bool.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/Sema/warn-bitwise-negation-bool.c b/test/Sema/warn-bitwise-negation-bool.c index 1d39f0c576..03d1ea4165 100644 --- a/test/Sema/warn-bitwise-negation-bool.c +++ b/test/Sema/warn-bitwise-negation-bool.c @@ -12,9 +12,11 @@ typedef _Bool boolean; #endif void test(boolean b, int i) { - b = ~b; // expected-warning {{bitwise negation of a boolean expression always evaluates to 'true'}} + b = ~b; // expected-warning {{bitwise negation of a boolean expression; did you mean a logicial negation?}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:8}:"!" - b = ~(b); // expected-warning {{bitwise negation of a boolean expression always evaluates to 'true'}} + b = ~(b); // expected-warning {{bitwise negation of a boolean expression; did you mean a logicial negation?}} // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:8}:"!" b = ~i; + i = ~b; // expected-warning {{bitwise negation of a boolean expression; did you mean a logicial negation?}} + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:7-[[@LINE-1]]:8}:"!" } |