diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-17 22:35:55 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-17 22:35:55 +0000 |
commit | bbdcc797eafc57ef68c5dff12bff63f780cffcd1 (patch) | |
tree | 2b8aade990ea880a225c9d2959e1a6b93ece70bb /gcc/expr.c | |
parent | b045b471176f52ba6ea2fbd3dbfc4bbbd278ee10 (diff) | |
download | gcc-bbdcc797eafc57ef68c5dff12bff63f780cffcd1.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83320 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index a3f89a1d2ed..651d6cd0142 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)); |