Commit f107ee33 by Jason Merrill Committed by Jason Merrill

* tree.c (build_target_expr): Copy the location from value.

From-SVN: r226580
parent cb3582ef
2015-08-04 Jason Merrill <jason@redhat.com>
* tree.c (build_target_expr): Copy the location from value.
2015-08-02 Patrick Palka <ppalka@gcc.gnu.org> 2015-08-02 Patrick Palka <ppalka@gcc.gnu.org>
* parser.c (cp_parser_selection_statement): Move handling of * parser.c (cp_parser_selection_statement): Move handling of
......
...@@ -338,6 +338,8 @@ build_target_expr (tree decl, tree value, tsubst_flags_t complain) ...@@ -338,6 +338,8 @@ build_target_expr (tree decl, tree value, tsubst_flags_t complain)
if (t == error_mark_node) if (t == error_mark_node)
return error_mark_node; return error_mark_node;
t = build4 (TARGET_EXPR, type, decl, value, t, NULL_TREE); t = build4 (TARGET_EXPR, type, decl, value, t, NULL_TREE);
if (EXPR_HAS_LOCATION (value))
SET_EXPR_LOCATION (t, EXPR_LOCATION (value));
/* We always set TREE_SIDE_EFFECTS so that expand_expr does not /* We always set TREE_SIDE_EFFECTS so that expand_expr does not
ignore the TARGET_EXPR. If there really turn out to be no ignore the TARGET_EXPR. If there really turn out to be no
side-effects, then the optimizer should be able to get rid of side-effects, then the optimizer should be able to get rid of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment