]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++, coroutines: Look through initial_await target exprs [PR110635].
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 19 Aug 2024 19:50:54 +0000 (20:50 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 24 Aug 2024 18:56:28 +0000 (19:56 +0100)
commitc442a9b78bdbebdbcb4a8f91bc36961eb732fbdf
tree68fa467e9528c5638883f3e6940abade29ab838d
parentf0315f7a325ffccb446fe378fcdfccda6eead8ba
c++, coroutines: Look through initial_await target exprs [PR110635].

In the case that the initial awaiter returns an object, the initial await
can be a target expression and we need to look at its initializer to cast
the await_resume() to void and to wrap in a compound expression that sets
the initial_await_resume_called flag.

PR c++/110635

gcc/cp/ChangeLog:

* coroutines.cc
(cp_coroutine_transform::wrap_original_function_body): Look through
initial await target expressions to find the actual co_await_expr
that we need to update.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr110635.C: New test.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/pr110635.C [new file with mode: 0644]