summaryrefslogtreecommitdiffstats
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-19 11:04:13 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-19 11:04:13 +0000
commit03033af4c1f68904bbecf8aaa95b58d285847c5c (patch)
treebcaf465ab5ba49fd67b08ce44d9d4349c54cc20e /gcc/c-typeck.c
parent3e682e423ffe1603a4533e89fc766a39c86caeef (diff)
downloadppe42-gcc-03033af4c1f68904bbecf8aaa95b58d285847c5c.tar.gz
ppe42-gcc-03033af4c1f68904bbecf8aaa95b58d285847c5c.zip
2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/32061 PR c++/36954 * doc/invoke.texi: Add -Wlogical-op to -Wextra. * common.opt (Wlogical-op): Move from here... * c.opt (Wlogical-op): ... to here. * c-typeck.c (parser_build_binary_op): Update call to warn_logical_operator. * c-opts.c (c_common_post_options): Enable warn_logical_op with extra_warnings. * c-common.c (warn_logical_op): Update. * c-common.h (warn_logical_op): Update declaration. cp/ * call.c (build_new_op): Save the original codes of operands before folding. testsuite/ * gcc.dg/pr32061.c: New. * gcc.dg/Wlogical-op-1.c: Update. * g++.dg/warn/Wlogical-op-1.C: Update. * g++.dg/warn/pr36954.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 77eafbff009..821f4ce13a6 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2925,8 +2925,9 @@ parser_build_binary_op (location_t location, enum tree_code code,
if (warn_parentheses)
warn_about_parentheses (code, code1, arg1.value, code2, arg2.value);
- if (TREE_CODE_CLASS (code1) != tcc_comparison)
- warn_logical_operator (code, arg1.value, arg2.value);
+ if (warn_logical_op)
+ warn_logical_operator (input_location, code,
+ code1, arg1.value, code2, arg2.value);
/* Warn about comparisons against string literals, with the exception
of testing for equality or inequality of a string literal with NULL. */
OpenPOWER on IntegriCloud