aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-08-04 11:18:40 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-08-04 11:18:40 -0400
commitf107ee3310e54209571c0466e019fb0e5989bf30 (patch)
treedb6c8dd799619a58767778e73414e4d07585e8ff /gcc/cp/tree.c
parentcb3582ef4b76fdc66191f53fbb9c20fdb8c51e03 (diff)
downloadgcc-f107ee3310e54209571c0466e019fb0e5989bf30.zip
gcc-f107ee3310e54209571c0466e019fb0e5989bf30.tar.gz
gcc-f107ee3310e54209571c0466e019fb0e5989bf30.tar.bz2
* tree.c (build_target_expr): Copy the location from value.
From-SVN: r226580
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 149c37d..46818b4 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -338,6 +338,8 @@ build_target_expr (tree decl, tree value, tsubst_flags_t complain)
if (t == error_mark_node)
return error_mark_node;
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
ignore the TARGET_EXPR. If there really turn out to be no
side-effects, then the optimizer should be able to get rid of