diff options
author | Marek Polacek <polacek@redhat.com> | 2014-06-23 16:38:48 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-06-23 16:38:48 +0000 |
commit | 47c2554f61d9b4e7e0326515ceef6f6169df6e78 (patch) | |
tree | 327c8d98bb9373c549a6b3b08e8049a178069ae0 /gcc/c | |
parent | 228e5d2b0cb64bad4f3f96a0723c14dd6a378c8b (diff) | |
download | gcc-47c2554f61d9b4e7e0326515ceef6f6169df6e78.zip gcc-47c2554f61d9b4e7e0326515ceef6f6169df6e78.tar.gz gcc-47c2554f61d9b4e7e0326515ceef6f6169df6e78.tar.bz2 |
c-typeck.c (parser_build_binary_op): Don't call warn_logical_not_parentheses if the RHS is TRUTH_NOT_EXPR.
* c-typeck.c (parser_build_binary_op): Don't call
warn_logical_not_parentheses if the RHS is TRUTH_NOT_EXPR.
* c-c++-common/pr49706-2.c: New test.
From-SVN: r211902
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index cc3e5fe..0972fde 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2014-06-23 Marek Polacek <polacek@redhat.com> + + * c-typeck.c (parser_build_binary_op): Don't call + warn_logical_not_parentheses if the RHS is TRUTH_NOT_EXPR. + 2014-06-15 Jan Hubicka <hubicka@ucw.cz> * c-parser.c (c_parser_omp_threadprivate): Likewise. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 63bd65e..0764630 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -3402,7 +3402,8 @@ parser_build_binary_op (location_t location, enum tree_code code, code1, arg1.value, code2, arg2.value); if (warn_logical_not_paren - && code1 == TRUTH_NOT_EXPR) + && code1 == TRUTH_NOT_EXPR + && code2 != TRUTH_NOT_EXPR) warn_logical_not_parentheses (location, code, arg1.value, arg2.value); /* Warn about comparisons against string literals, with the exception |