]> git.ipfire.org Git - thirdparty/gcc.git/commit
coroutines: Await expressions are not allowed in handlers [PR 99710].
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 2 Oct 2021 13:43:39 +0000 (14:43 +0100)
committerIain Sandoe <iains@gcc.gnu.org>
Thu, 27 Jun 2024 12:55:08 +0000 (13:55 +0100)
commit57482cadeb12af2dd52b381b0766776d1e8ec59b
tree4ad501620107b4663a00b8a82de5c4a25271c9c0
parentbb943609534fcbd984d39a9a7efef12fa2667ac6
coroutines: Await expressions are not allowed in handlers [PR 99710].

C++20 [expr.await] / 2
An await-expression shall appear only in a potentially-evaluated expression
within the compound-statement of a function-body outside of a handler.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/99710

gcc/cp/ChangeLog:

* coroutines.cc (await_statement_walker): Report an error if
an await expression is found in a handler body.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit 650beb110538097b9c3e8600149b333a83e7e836)
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/pr99710.C [new file with mode: 0644]