diff options
author | Jason Merrill <jason@redhat.com> | 2011-05-02 18:00:07 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-05-02 18:00:07 -0400 |
commit | b73a47045560ac7b2b808736383e8b5f8a97f55a (patch) | |
tree | b12080d3b449b44ff26a30a933c60a85a3b7b7ae /gcc/cp/init.c | |
parent | 3533b943d1c7a7afec4f85750e2a463e277aa0d8 (diff) | |
download | gcc-b73a47045560ac7b2b808736383e8b5f8a97f55a.zip gcc-b73a47045560ac7b2b808736383e8b5f8a97f55a.tar.gz gcc-b73a47045560ac7b2b808736383e8b5f8a97f55a.tar.bz2 |
revert: re PR c++/40975 (ICE in copy_tree_r on array new)
Revert:
PR c++/40975
* cp-tree.def (VEC_INIT_EXPR): Add third operand.
* cp-tree.h (VEC_INIT_EXPR_NELTS): New.
* cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it.
* tree.c (build_vec_init_expr): Handle getting pointer/nelts.
(build_vec_init_elt): Don't expect an array type.
(build_array_copy): Adjust.
* init.c (perform_member_init): Adjust.
(build_new_1): Use build_vec_init_expr.
From-SVN: r173274
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index d8b19c7..50dbcc9 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -506,8 +506,7 @@ perform_member_init (tree member, tree init) /* mem() means value-initialization. */ if (TREE_CODE (type) == ARRAY_TYPE) { - init = build_vec_init_expr (type, init, NULL_TREE, - tf_warning_or_error); + init = build_vec_init_expr (type, init); init = build2 (INIT_EXPR, type, decl, init); finish_expr_stmt (init); } @@ -544,8 +543,7 @@ perform_member_init (tree member, tree init) || same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (init))) { - init = build_vec_init_expr (type, init, NULL_TREE, - tf_warning_or_error); + init = build_vec_init_expr (type, init); init = build2 (INIT_EXPR, type, decl, init); finish_expr_stmt (init); } @@ -2388,14 +2386,15 @@ build_new_1 (VEC(tree,gc) **placement, tree type, tree nelts, vecinit = build_tree_list_vec (*init); } init_expr - = build_vec_init_expr (data_addr, - (explicit_value_init_p - ? void_type_node: vecinit), - cp_build_binary_op (input_location, - MINUS_EXPR, outer_nelts, - integer_one_node, - complain), - complain); + = build_vec_init (data_addr, + cp_build_binary_op (input_location, + MINUS_EXPR, outer_nelts, + integer_one_node, + complain), + vecinit, + explicit_value_init_p, + /*from_array=*/0, + complain); /* An array initialization is stable because the initialization of each element is a full-expression, so the temporaries don't |