diff options
author | Marek Polacek <polacek@redhat.com> | 2016-08-25 12:48:34 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-08-25 12:48:34 +0000 |
commit | ebef225f4d824e45982955fe2a3cceb4f8cbae0e (patch) | |
tree | 64f9fab13affc9a9f00a3ad4510b0ea04da7f713 /gcc/c | |
parent | 30df8b9f1e45879851eca44923eb77b0099fa24e (diff) | |
download | gcc-ebef225f4d824e45982955fe2a3cceb4f8cbae0e.zip gcc-ebef225f4d824e45982955fe2a3cceb4f8cbae0e.tar.gz gcc-ebef225f4d824e45982955fe2a3cceb4f8cbae0e.tar.bz2 |
c-common.c (warn_logical_not_parentheses): Print fixit hints.
* c-common.c (warn_logical_not_parentheses): Print fixit hints.
* c-common.h (warn_logical_not_parentheses): Update declaration.
* c-typeck.c (parser_build_binary_op): Pass LHS to
warn_logical_not_parentheses.
* parser.c (cp_parser_binary_expression): Pass LHS to
warn_logical_not_parentheses.
* c-c++-common/Wlogical-not-parentheses-2.c: New test.
Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
From-SVN: r239756
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index dc863bb..774e580 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,10 @@ 2016-08-25 Marek Polacek <polacek@redhat.com> + * c-typeck.c (parser_build_binary_op): Pass LHS to + warn_logical_not_parentheses. + +2016-08-25 Marek Polacek <polacek@redhat.com> + PR c/77323 * c-decl.c (declspecs_add_type): Set typespec_word even when __intN or _FloatN or _FloatNx is not supported. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index bc8728a..2f8d611 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -3696,7 +3696,7 @@ parser_build_binary_op (location_t location, enum tree_code code, while (1); } if (TREE_CODE (TREE_TYPE (t)) != BOOLEAN_TYPE) - warn_logical_not_parentheses (location, code, arg2.value); + warn_logical_not_parentheses (location, code, arg1.value, arg2.value); } /* Warn about comparisons against string literals, with the exception |