re PR c++/16112 (ICE with statement expression in return statement)

PR c++/16112
        * cp-gimplify.c (cp_gimplify_init_expr): Look through
        CLEANUP_POINT_EXPR.

From-SVN: r83514
This commit is contained in:
Jason Merrill 2004-06-22 17:15:29 -04:00 committed by Jason Merrill
parent 96a4ec035d
commit 28c6dc6359
3 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2004-06-21 Jason Merrill <jason@redhat.com>
* cp-gimplify.c (cp_gimplify_init_expr): Look throug
2004-06-21 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (NEW_EXPR): Add a fourth slot.

View File

@ -116,6 +116,8 @@ cp_gimplify_init_expr (tree *expr_p, tree *pre_p, tree *post_p)
case, I guess we'll need to replace references somehow. */
if (TREE_CODE (from) == TARGET_EXPR)
from = TARGET_EXPR_INITIAL (from);
if (TREE_CODE (from) == CLEANUP_POINT_EXPR)
from = TREE_OPERAND (from, 0);
/* Look through any COMPOUND_EXPRs. */
sub = expr_last (from);

View File

@ -0,0 +1,9 @@
// PR c++/16112
// { dg-options "" }
struct A
{
A();
};
A foo() { return ({ A(); }); }