diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2021-10-02 17:20:08 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2021-12-17 16:57:47 +0000 |
commit | 2466a8d0dd40d05cb4a239d7d4a21bbd9ffab698 (patch) | |
tree | 52c549a73230b5b77b3da4bd2ba296f85af36860 /gcc/config.gcc | |
parent | 921942a8a106cb53994c21162922e4934eb3a3e0 (diff) | |
download | gcc-2466a8d0dd40d05cb4a239d7d4a21bbd9ffab698.zip gcc-2466a8d0dd40d05cb4a239d7d4a21bbd9ffab698.tar.gz gcc-2466a8d0dd40d05cb4a239d7d4a21bbd9ffab698.tar.bz2 |
coroutines: Handle initial awaiters with non-void returns [PR 100127].
The way in which a C++20 coroutine is specified discards any value
that might be returned from the initial or final await expressions.
This ICE was caused by an initial await expression with an
await_resume () returning a reference, the function rewrite code
was not set up to expect this.
Fixed by looking through any indirection present and by explicitly
discarding the value, if any, returned by await_resume().
It does not seem useful to make a diagnostic for this, since
the user could define a generic awaiter that usefully returns
values when used in a different position from the initial (or
final) await expressions.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/100127
gcc/cp/ChangeLog:
* coroutines.cc (coro_rewrite_function_body): Handle initial
await expressions that try to produce a reference value.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/pr100127.C: New test.
Diffstat (limited to 'gcc/config.gcc')
0 files changed, 0 insertions, 0 deletions