From 1f2911476d723f30c53dd175589b2b561e36c439 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 29 Jun 2011 10:34:22 -0400 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/semantics.c | 2 +- gcc/cp/tree.c | 3 --- gcc/cp/typeck2.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2f7b215d97b..e25f4e04490 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-06-29 Jason Merrill + * 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 based on user-providedness of default ctor, not any ctor. (build_value_init_noctor): Adjust assert. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index d1af0c6bc2d..8121a0020b5 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6646,7 +6646,7 @@ cxx_eval_vec_init_1 (const constexpr_call *call, tree atype, tree init, if (!*non_constant_p) { - init = build_constructor (TREE_TYPE (atype), n); + init = build_constructor (atype, n); TREE_CONSTANT (init) = true; return init; } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 31005084b3c..c50751f7ebb 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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_VALUE_INIT (init) = value_init; - init = build_target_expr (slot, init, complain); - TARGET_EXPR_IMPLICIT_P (init) = 1; - return init; } diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 8bb938e46a8..023fab3321d 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -925,7 +925,7 @@ digest_init_r (tree type, tree init, bool nested, int flags, { /* Allow the result of build_array_copy and of build_value_init_noctor. */ - if ((TREE_CODE (init) == TARGET_EXPR + if ((TREE_CODE (init) == VEC_INIT_EXPR || TREE_CODE (init) == CONSTRUCTOR) && (same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (init)))) -- 2.30.2