aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-common.c7
2 files changed, 8 insertions, 5 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index d8f1808..5a2cbbe 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-13 David Malcolm <dmalcolm@redhat.com>
+
+ * c-common.c (warn_logical_not_parentheses): Replace
+ rich_location::add_fixit_insert calls with add_fixit_insert_before
+ and add_fixit_insert_after, eliminating the "next_loc" calculation.
+
2016-09-13 Jason Merrill <jason@redhat.com>
Tom de Vries <tom@codesourcery.com>
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 73bd43f8..1132a03 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -1544,11 +1544,8 @@ warn_logical_not_parentheses (location_t location, enum tree_code code,
{
location_t lhs_loc = EXPR_LOCATION (lhs);
rich_location richloc (line_table, lhs_loc);
- richloc.add_fixit_insert (lhs_loc, "(");
- location_t finish = get_finish (lhs_loc);
- location_t next_loc
- = linemap_position_for_loc_and_offset (line_table, finish, 1);
- richloc.add_fixit_insert (next_loc, ")");
+ richloc.add_fixit_insert_before (lhs_loc, "(");
+ richloc.add_fixit_insert_after (lhs_loc, ")");
inform_at_rich_loc (&richloc, "add parentheses around left hand side "
"expression to silence this warning");
}