c++, coroutines: Handle unevaluated contexts.
From [expr.await]/2
We should not accept co_await, co_yield in unevaluated contexts.
Currently (see PR68604) we do not mark typeid expressions as unevaluated
since the standard rules mean that this depends on the value type.
gcc/cp/ChangeLog:
* coroutines.cc (finish_co_await_expr): Do not allow in an
unevaluated context.
(finish_co_yield_expr): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/unevaluated.C: New test.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit
e2bff264e8b92426b13aacec3087cb97971ec9b9)