tree.c (build_vec_init_expr): Don't add TARGET_EXPR.

* tree.c (build_vec_init_expr): Don't add TARGET_EXPR.
	* typeck2.c (digest_init_r): Handle VEC_INIT_EXPR.
	* semantics.c (cxx_eval_vec_init_1): Correct type.

From-SVN: r175643
This commit is contained in:
Jason Merrill 2011-06-29 10:34:22 -04:00 committed by Jason Merrill
parent dfedbe4055
commit 1f2911476d
4 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,9 @@
2011-06-29 Jason Merrill <jason@redhat.com> 2011-06-29 Jason Merrill <jason@redhat.com>
* tree.c (build_vec_init_expr): Don't add TARGET_EXPR.
* typeck2.c (digest_init_r): Handle VEC_INIT_EXPR.
* semantics.c (cxx_eval_vec_init_1): Correct type.
* init.c (build_value_init): Decide whether or not to zero-initialize * init.c (build_value_init): Decide whether or not to zero-initialize
based on user-providedness of default ctor, not any ctor. based on user-providedness of default ctor, not any ctor.
(build_value_init_noctor): Adjust assert. (build_value_init_noctor): Adjust assert.

View File

@ -6646,7 +6646,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init,
if (!*non_constant_p) if (!*non_constant_p)
{ {
init = build_constructor (TREE_TYPE (atype), n); init = build_constructor (atype, n);
TREE_CONSTANT (init) = true; TREE_CONSTANT (init) = true;
return init; return init;
} }

View File

@ -541,9 +541,6 @@ build_vec_init_expr (tree type, tree init, tsubst_flags_t complain)
VEC_INIT_EXPR_IS_CONSTEXPR (init) = true; VEC_INIT_EXPR_IS_CONSTEXPR (init) = true;
VEC_INIT_EXPR_VALUE_INIT (init) = value_init; VEC_INIT_EXPR_VALUE_INIT (init) = value_init;
init = build_target_expr (slot, init, complain);
TARGET_EXPR_IMPLICIT_P (init) = 1;
return init; return init;
} }

View File

@ -925,7 +925,7 @@ digest_init_r (tree type, tree init, bool nested, int flags,
{ {
/* Allow the result of build_array_copy and of /* Allow the result of build_array_copy and of
build_value_init_noctor. */ build_value_init_noctor. */
if ((TREE_CODE (init) == TARGET_EXPR if ((TREE_CODE (init) == VEC_INIT_EXPR
|| TREE_CODE (init) == CONSTRUCTOR) || TREE_CODE (init) == CONSTRUCTOR)
&& (same_type_ignoring_top_level_qualifiers_p && (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (init)))) (type, TREE_TYPE (init))))