+2013-11-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/58868
+ * init.c (build_aggr_init): Don't clobber the type of init
+ if we got an INIT_EXPR back from build_vec_init.
+ (build_vec_init): Do digest_init on trivial initialization.
+
2013-11-23 Alexander Ivchenko <alexander.ivchenko@intel.com>
PR c++/58525
TREE_READONLY (exp) = was_const;
TREE_THIS_VOLATILE (exp) = was_volatile;
TREE_TYPE (exp) = type;
- if (init)
+ /* Restore the type of init unless it was used directly. */
+ if (init && TREE_CODE (stmt_expr) != INIT_EXPR)
TREE_TYPE (init) = itype;
return stmt_expr;
}
brace-enclosed initializers. In this case, digest_init and
store_constructor will handle the semantics for us. */
+ if (BRACE_ENCLOSED_INITIALIZER_P (init))
+ init = digest_init (atype, init, complain);
stmt_expr = build2 (INIT_EXPR, atype, base, init);
if (length_check)
stmt_expr = build3 (COND_EXPR, atype, length_check,