tree.c (build_vec_init_expr): Don't add TARGET_EXPR.
authorJason Merrill <jason@redhat.com>
Wed, 29 Jun 2011 14:34:22 +0000 (10:34 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 29 Jun 2011 14:34:22 +0000 (10:34 -0400)
* 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
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck2.c

index 2f7b215..e25f4e0 100644 (file)
@@ -1,5 +1,9 @@
 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
        based on user-providedness of default ctor, not any ctor.
        (build_value_init_noctor): Adjust assert.
index d1af0c6..8121a00 100644 (file)
@@ -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;
     }
index 3100508..c50751f 100644 (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_VALUE_INIT (init) = value_init;
 
-  init = build_target_expr (slot, init, complain);
-  TARGET_EXPR_IMPLICIT_P (init) = 1;
-
   return init;
 }
 
index 8bb938e..023fab3 100644 (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
             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))))