aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 3a9a86d..290e73b 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -787,7 +787,15 @@ 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, complain);
+ tree elt_init;
+ if (init && TREE_CODE (init) == CONSTRUCTOR)
+ {
+ gcc_assert (!BRACE_ENCLOSED_INITIALIZER_P (init));
+ /* We built any needed constructor calls in digest_init. */
+ elt_init = init;
+ }
+ else
+ elt_init = build_vec_init_elt (type, init, complain);
if (init == void_type_node)
{