-
- Downloads
coroutines: Fix handling of target cleanup exprs [PR94883]
The problem here is that target cleanup expressions have been added to the initialisers for the awaitable (and returns of non-trivial values from await_suspend() calls. This is because the expansion of the co_await into its control flow is not apparent to the machinery adding the target cleanup expressions. The solution being tested is simply to recreate target expressions as the co_awaits are lowered. Teaching the machinery to handle walking co_await expressions in different ways at different points (outside the coroutine transformation) seems overly complex. gcc/cp/ChangeLog: 2020-04-30 Iain Sandoe <iain@sandoe.co.uk> PR c++/94883 * coroutines.cc (register_awaits): Update target expressions for awaitable and suspend handle initializers. gcc/testsuite/ChangeLog: 2020-04-30 Iain Sandoe <iain@sandoe.co.uk> PR c++/94883 * g++.dg/coroutines/pr94883-folly-2.C: New test.
Showing
- gcc/cp/ChangeLog 7 additions, 0 deletionsgcc/cp/ChangeLog
- gcc/cp/coroutines.cc 11 additions, 0 deletionsgcc/cp/coroutines.cc
- gcc/testsuite/ChangeLog 5 additions, 0 deletionsgcc/testsuite/ChangeLog
- gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C 64 additions, 0 deletionsgcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C
Loading
Please register or sign in to comment