diff options
author | Jason Merrill <jason@redhat.com> | 2011-05-02 18:00:16 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-05-02 18:00:16 -0400 |
commit | 9c69dcea0d67714ca0ce52317725ccf1644ce93e (patch) | |
tree | f338955c0b3529289670686e025251dc71b8089e /gcc/cp/tree.c | |
parent | b73a47045560ac7b2b808736383e8b5f8a97f55a (diff) | |
download | gcc-9c69dcea0d67714ca0ce52317725ccf1644ce93e.zip gcc-9c69dcea0d67714ca0ce52317725ccf1644ce93e.tar.gz gcc-9c69dcea0d67714ca0ce52317725ccf1644ce93e.tar.bz2 |
tree.c (build_vec_init_expr): Take complain parm.
* tree.c (build_vec_init_expr): Take complain parm.
(build_vec_init_elt): Likewise. Free arg vector.
(diagnose_non_constexpr_vec_init, build_array_copy): Adjust.
* cp-tree.h (VEC_INIT_EXPR_SLOT): Use VEC_INIT_EXPR_CHECK.
(VEC_INIT_EXPR_INIT): Likewise.
Adjust build_vec_init_expr declaration.
* init.c (perform_member_init): Adjust.
From-SVN: r173275
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index dfd11ad..0f2f86c 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -475,7 +475,7 @@ build_cplus_new (tree type, tree init, tsubst_flags_t complain) another array to copy. */ static tree -build_vec_init_elt (tree type, tree init) +build_vec_init_elt (tree type, tree init, tsubst_flags_t complain) { tree inner_type = strip_array_types (type); VEC(tree,gc) *argvec; @@ -485,7 +485,7 @@ build_vec_init_elt (tree type, tree init) /* No interesting initialization to do. */ return integer_zero_node; else if (init == void_type_node) - return build_value_init (inner_type, tf_warning_or_error); + return build_value_init (inner_type, complain); gcc_assert (init == NULL_TREE || (same_type_ignoring_top_level_qualifiers_p @@ -499,9 +499,12 @@ build_vec_init_elt (tree type, tree init) dummy = move (dummy); VEC_quick_push (tree, argvec, dummy); } - return build_special_member_call (NULL_TREE, complete_ctor_identifier, + init = build_special_member_call (NULL_TREE, complete_ctor_identifier, &argvec, inner_type, LOOKUP_NORMAL, - tf_warning_or_error); + complain); + release_tree_vector (argvec); + + return init; } /* Return a TARGET_EXPR which expresses the initialization of an array to @@ -509,11 +512,11 @@ build_vec_init_elt (tree type, tree init) from another array of the same type. */ tree -build_vec_init_expr (tree type, tree init) +build_vec_init_expr (tree type, tree init, tsubst_flags_t complain) { tree slot; bool value_init = false; - tree elt_init = build_vec_init_elt (type, init); + tree elt_init = build_vec_init_elt (type, init, complain); if (init == void_type_node) { @@ -550,14 +553,14 @@ diagnose_non_constexpr_vec_init (tree expr) else init = VEC_INIT_EXPR_INIT (expr); - elt_init = build_vec_init_elt (type, init); + elt_init = build_vec_init_elt (type, init, tf_warning_or_error); require_potential_constant_expression (elt_init); } tree build_array_copy (tree init) { - return build_vec_init_expr (TREE_TYPE (init), init); + return build_vec_init_expr (TREE_TYPE (init), init, tf_warning_or_error); } /* Build a TARGET_EXPR using INIT to initialize a new temporary of the |