[Bug c++/98480] [coroutines] ICE on co_await in for-loop end condition.
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 22 22:04:23 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98480
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:
https://gcc.gnu.org/g:c38db3729b9a895a8dcf3ef28924822b28ad5c01
commit r10-9516-gc38db3729b9a895a8dcf3ef28924822b28ad5c01
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Thu Mar 11 14:22:37 2021 +0000
coroutines : Handle for await expressions in for stmts [PR98480].
The handling of await expressions in the init, condition and iteration
expressions of for loops had been omitted. Fixed thus.
gcc/cp/ChangeLog:
PR c++/98480
* coroutines.cc (replace_continue): Rewrite continue into
'goto label'.
(await_statement_walker): Handle await expressions in the
initializer, condition and iteration expressions of for
loops.
gcc/testsuite/ChangeLog:
PR c++/98480
* g++.dg/coroutines/pr98480.C: New test.
* g++.dg/coroutines/torture/co-await-24-for-init.C: New test.
* g++.dg/coroutines/torture/co-await-25-for-condition.C: New test.
* g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C: New
test.
(cherry picked from commit 26e0eb1071e318728bcd33f28d055729ac48792c)
More information about the Gcc-bugs
mailing list