summaryrefslogtreecommitdiffstats
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 27cb784913a..2b0f0c685ba 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7199,7 +7199,7 @@ grok_reference_init (tree decl, tree type, tree init)
}
if (TREE_CODE (init) == TREE_LIST)
- init = build_compound_expr (init);
+ init = build_x_compound_expr_from_list (init, "initializer");
if (TREE_CODE (TREE_TYPE (init)) == REFERENCE_TYPE)
init = convert_from_reference (init);
@@ -8577,12 +8577,7 @@ expand_static_init (tree decl, tree init)
run until after TEMP is set to 1. */
guard_init = set_guard (guard);
if (assignment)
- {
- assignment = tree_cons (NULL_TREE, assignment,
- build_tree_list (NULL_TREE,
- guard_init));
- assignment = build_compound_expr (assignment);
- }
+ assignment = build_compound_expr (assignment, guard_init);
else
assignment = guard_init;
finish_expr_stmt (assignment);
@@ -14389,8 +14384,7 @@ cxx_maybe_build_cleanup (tree decl)
if (TYPE_USES_VIRTUAL_BASECLASSES (type)
&& ! TYPE_HAS_DESTRUCTOR (type))
- rval = build_compound_expr (tree_cons (NULL_TREE, rval,
- build_tree_list (NULL_TREE, build_vbase_delete (type, decl))));
+ rval = build_compound_expr (rval, build_vbase_delete (type, decl));
return rval;
}
OpenPOWER on IntegriCloud