]> gcc.gnu.org Git - gcc.git/commit
c++, coroutines: Fix block nests when the function has no top-level bind.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 1 Apr 2023 16:23:51 +0000 (21:53 +0530)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 30 Apr 2023 08:27:41 +0000 (09:27 +0100)
commit66e43c2387402f1fd48c71fe10275fa8f4c427d5
tree7159073cb08549a40585aa8e67d1e4b21688102d
parentb7e75cdb218f25708b8b1aa3f4b138d88187491f
c++, coroutines: Fix block nests when the function has no top-level bind.

When the function contains no local vars and also no nested scopes, there
is no top-level bind expression.  Because the rewritten coroutine body will
require both local vars and contain nested scopes, we add a bind expression
to such functions.  When this was done the necessary scope blocks were
omitted which leads to disconnected function content.

Fixed by adding a new block to the added bind expression.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/ChangeLog:

* coroutines.cc (coro_rewrite_function_body): Ensure that added
bind expressions have scope blocks.

(cherry picked from commit a8d7631d333c22e38a067d32d11fd2b60cf1d960)
gcc/cp/coroutines.cc
This page took 0.067242 seconds and 6 git commands to generate.