Commit 28c6dc63 by Jason Merrill Committed by Jason Merrill

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
parent 96a4ec03
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> 2004-06-21 Mark Mitchell <mark@codesourcery.com>
* cp-tree.def (NEW_EXPR): Add a fourth slot. * cp-tree.def (NEW_EXPR): Add a fourth slot.
......
...@@ -116,6 +116,8 @@ cp_gimplify_init_expr (tree *expr_p, tree *pre_p, tree *post_p) ...@@ -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. */ case, I guess we'll need to replace references somehow. */
if (TREE_CODE (from) == TARGET_EXPR) if (TREE_CODE (from) == TARGET_EXPR)
from = TARGET_EXPR_INITIAL (from); from = TARGET_EXPR_INITIAL (from);
if (TREE_CODE (from) == CLEANUP_POINT_EXPR)
from = TREE_OPERAND (from, 0);
/* Look through any COMPOUND_EXPRs. */ /* Look through any COMPOUND_EXPRs. */
sub = expr_last (from); sub = expr_last (from);
......
// PR c++/16112
// { dg-options "" }
struct A
{
A();
};
A foo() { return ({ A(); }); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment