aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-08-25 12:48:34 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-08-25 12:48:34 +0000
commitebef225f4d824e45982955fe2a3cceb4f8cbae0e (patch)
tree64f9fab13affc9a9f00a3ad4510b0ea04da7f713 /gcc/cp/parser.c
parent30df8b9f1e45879851eca44923eb77b0099fa24e (diff)
downloadgcc-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/cp/parser.c')
-rw-r--r--gcc/cp/parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 690e928..d54cf8a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8922,7 +8922,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
|| TREE_TYPE (current.lhs) == NULL_TREE
|| TREE_CODE (TREE_TYPE (current.lhs)) != BOOLEAN_TYPE))
warn_logical_not_parentheses (current.loc, current.tree_type,
- maybe_constant_value (rhs));
+ current.lhs, maybe_constant_value (rhs));
overload = NULL;