summaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-31 18:46:05 +0000
committerbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-31 18:46:05 +0000
commit3e76c73d74408b80d7e33a9589021ab05ae0f94d (patch)
treeeec692b17e05c30eceb8a803d7f44094c82ca16c /gcc/cp/call.c
parent1dbe1bb19c674745941ca05ed462363916ae8705 (diff)
parent9635c0c3aa804dd411dfdcaa3322bd6096dbaf0c (diff)
downloadgcc-3e76c73d74408b80d7e33a9589021ab05ae0f94d.tar.gz
Merged with trunk at revision 188063.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/cilkplus@188074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 29fb195f131..4c99068587c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -5868,11 +5868,15 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
(elttype, cp_type_quals (elttype) | TYPE_QUAL_CONST);
array = build_array_of_n_type (elttype, len);
array = finish_compound_literal (array, new_ctor, complain);
+ /* Take the address explicitly rather than via decay_conversion
+ to avoid the error about taking the address of a temporary. */
+ array = cp_build_addr_expr (array, complain);
+ array = cp_convert (build_pointer_type (elttype), array);
/* Build up the initializer_list object. */
totype = complete_type (totype);
field = next_initializable_field (TYPE_FIELDS (totype));
- CONSTRUCTOR_APPEND_ELT (vec, field, decay_conversion (array, complain));
+ CONSTRUCTOR_APPEND_ELT (vec, field, array);
field = next_initializable_field (DECL_CHAIN (field));
CONSTRUCTOR_APPEND_ELT (vec, field, size_int (len));
new_ctor = build_constructor (totype, vec);