summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-09 17:01:11 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-09 17:01:11 +0000
commit991e012e642db2f1bc5047e90d3335c1da303b94 (patch)
treea4a5965cd7037fa41bb79c122c4f78e759d18a04 /gcc/cp
parent1a6ad4540330ac6c7321225696c8c6b63a17c3e3 (diff)
downloadgcc-991e012e642db2f1bc5047e90d3335c1da303b94.tar.gz
* tree.c (build_vec_init_elt): Strip TARGET_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/tree.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index cbdc4d83df2..c19e8b38762 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-09 Jason Merrill <jason@redhat.com>
+
+ * tree.c (build_vec_init_elt): Strip TARGET_EXPR.
+
2011-07-08 Jason Merrill <jason@redhat.com>
PR c++/45437
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index dcd85e40c98..4ef89c45f65 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -511,6 +511,11 @@ build_vec_init_elt (tree type, tree init, tsubst_flags_t complain)
complain);
release_tree_vector (argvec);
+ /* For a trivial constructor, build_over_call creates a TARGET_EXPR. But
+ we don't want one here because we aren't creating a temporary. */
+ if (TREE_CODE (init) == TARGET_EXPR)
+ init = TARGET_EXPR_INITIAL (init);
+
return init;
}