Commit eecb13e8 by Jason Merrill Committed by Jason Merrill

re PR c++/24996 (ICE on throw code)

        PR c++/24996
        * except.c (build_throw): Add a CLEANUP_POINT_EXPR inside the
        TRY_CATCH_EXPR or MUST_NOT_THROW_EXPR.

From-SVN: r110889
parent 1d327c16
2006-02-12 Jason Merrill <jason@redhat.com>
PR c++/24996
* except.c (build_throw): Add a CLEANUP_POINT_EXPR inside the
TRY_CATCH_EXPR or MUST_NOT_THROW_EXPR.
2006-02-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-02-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* class.c (debug_class): Remove extern. * class.c (debug_class): Remove extern.
......
...@@ -722,6 +722,7 @@ build_throw (tree exp) ...@@ -722,6 +722,7 @@ build_throw (tree exp)
temp_expr = NULL_TREE; temp_expr = NULL_TREE;
stabilize_init (exp, &temp_expr); stabilize_init (exp, &temp_expr);
exp = build1 (CLEANUP_POINT_EXPR, TREE_TYPE (exp), exp);
if (elided) if (elided)
exp = build2 (TRY_CATCH_EXPR, void_type_node, exp, exp = build2 (TRY_CATCH_EXPR, void_type_node, exp,
do_free_exception (ptr)); do_free_exception (ptr));
......
// PR c++/24996
// Bug: the cleanup for the A temporary was confusing the gimplifier
// because of the TRY_CATCH_EXPR for the exception object.
struct A { A(int); ~A(); };
struct B { B(A); ~B(); };
void foo(bool b)
{
throw b ? B(1) : B(1);
}
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