aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2004-06-17 18:35:55 -0400
committerJason Merrill <jason@gcc.gnu.org>2004-06-17 18:35:55 -0400
commit2692eb7d0ea1757cbf2508f001be9ee9f2f87ed3 (patch)
tree2b8aade990ea880a225c9d2959e1a6b93ece70bb /gcc/expr.c
parent6ffbdf03e5d6863c7441dce9adab8fbf724bc8a4 (diff)
downloadgcc-2692eb7d0ea1757cbf2508f001be9ee9f2f87ed3.zip
gcc-2692eb7d0ea1757cbf2508f001be9ee9f2f87ed3.tar.gz
gcc-2692eb7d0ea1757cbf2508f001be9ee9f2f87ed3.tar.bz2
re PR c++/16015 (xfailed g++.dg/ext/stmtexpr1.C)
PR c++/16015 * gimplify.c (gimplify_target_expr): Handle void initializer. * expr.c (expand_expr_real_1) [TARGET_EXPR]: Likewise. * doc/c-tree.texi (Expression trees): Update TARGET_EXPR and AGGR_INIT_EXPR. * cp/semantics.c (simplify_aggr_init_expr): Don't return the slot. (finish_stmt_expr_expr): Update type after conversions. (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR. Handle void initializer. * cp/tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void. From-SVN: r83320
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index a3f89a1..651d6cd 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8862,7 +8862,12 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Mark it as expanded. */
TREE_OPERAND (exp, 1) = NULL_TREE;
- store_expr (exp1, target, modifier == EXPAND_STACK_PARM ? 2 : 0);
+ if (VOID_TYPE_P (TREE_TYPE (exp1)))
+ /* If the initializer is void, just expand it; it will initialize
+ the object directly. */
+ expand_expr (exp1, const0_rtx, VOIDmode, 0);
+ else
+ store_expr (exp1, target, modifier == EXPAND_STACK_PARM ? 2 : 0);
expand_decl_cleanup_eh (NULL_TREE, cleanups, CLEANUP_EH_ONLY (exp));