https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120400
Iain Sandoe <iains at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2025-05-23 Status|UNCONFIRMED |NEW --- Comment #14 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #13) > Created attachment 61500 [details] > possible fix > > Does this fix the issue? Yes, it does .. that's the kind of thing I was hoping for ... we also need the changes below - which I'll post separately. @@ -5017,7 +5020,7 @@ cp_coroutine_transform::build_ramp_function () tree frame_cleanup = push_stmt_list (); tree do_fr_cleanup = build1_loc (loc, TRUTH_NOT_EXPR, boolean_type_node, iarc_x); - do_fr_cleanup = build2_loc (loc, TRUTH_AND_EXPR, boolean_type_node, + do_fr_cleanup = build2_loc (loc, TRUTH_ANDIF_EXPR, boolean_type_node, coro_before_return, do_fr_cleanup); r = build3 (COND_EXPR, void_type_node, do_fr_cleanup, delete_frame_call, void_node); @@ -5109,7 +5112,7 @@ cp_coroutine_transform::build_ramp_function () tree do_cleanup = build1_loc (loc, TRUTH_NOT_EXPR, boolean_type_node, iarc_x); do_cleanup - = build2_loc (loc, TRUTH_AND_EXPR, boolean_type_node, + = build2_loc (loc, TRUTH_ANDIF_EXPR, boolean_type_node, coro_before_return, do_cleanup); r = build3_loc (loc, COND_EXPR, void_type_node, do_cleanup, parm.fr_copy_dtor, void_node); @@ -5169,7 +5172,7 @@ cp_coroutine_transform::build_ramp_function () tree promise_cleanup = push_stmt_list (); tree do_cleanup = build1_loc (loc, TRUTH_NOT_EXPR, boolean_type_node, iarc_x); - do_cleanup = build2_loc (loc, TRUTH_AND_EXPR, boolean_type_node, + do_cleanup = build2_loc (loc, TRUTH_ANDIF_EXPR, boolean_type_node, coro_before_return, do_cleanup); r = build3 (COND_EXPR, void_type_node, do_cleanup, promise_dtor, void_node);