diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-23 16:38:48 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-23 16:38:48 +0000 |
commit | 499b73907af6e1d35a7e6fdc93a276e563512f94 (patch) | |
tree | 327c8d98bb9373c549a6b3b08e8049a178069ae0 /gcc/c | |
parent | 79cf3b316b32972536c17b76ecfd0d1642d35506 (diff) | |
download | gcc-499b73907af6e1d35a7e6fdc93a276e563512f94.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211902 138bc75d-0d04-0410-961f-82ee72b054a4
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 cc3e5feda8a..0972fdebd24 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 63bd65ee0be..07646307af8 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 |