https://gcc.gnu.org/g:fe545ea3d82bc2ba65050d235375e8c943740ddc

commit r15-6265-gfe545ea3d82bc2ba65050d235375e8c943740ddc
Author: Iain Sandoe <i...@sandoe.co.uk>
Date:   Tue Sep 3 12:04:59 2024 +0100

    c++, coroutines: Use finish_if_stmt in a missed case.
    
    Just shorter code.
    
    gcc/cp/ChangeLog:
    
            * coroutines.cc
            (cp_coroutine_transform::wrap_original_function_body): Use
            finish_if_stmt instead of manually applying the same process.
    
    Signed-off-by: Iain Sandoe <i...@sandoe.co.uk>

Diff:
---
 gcc/cp/coroutines.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index c286af7bd076..1d75bbdf5d12 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -4483,10 +4483,7 @@ cp_coroutine_transform::wrap_original_function_body ()
       suppress_warning (rethrow);
       finish_expr_stmt (rethrow);
       finish_then_clause (not_iarc_if);
-      tree iarc_scope = IF_SCOPE (not_iarc_if);
-      IF_SCOPE (not_iarc_if) = NULL;
-      not_iarc_if = do_poplevel (iarc_scope);
-      add_stmt (not_iarc_if);
+      finish_if_stmt (not_iarc_if);
       /* ... else call the promise unhandled exception method
         but first we set done = true and the resume index to 0.
         If the unhandled exception method returns, then we continue

Reply via email to