https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95050
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>: https://gcc.gnu.org/g:324276ff9b1aa5128e5cb9f5d43182d1ebab0752 commit r11-835-g324276ff9b1aa5128e5cb9f5d43182d1ebab0752 Author: Iain Sandoe <i...@sandoe.co.uk> Date: Tue Jun 2 16:47:54 2020 +0100 coroutines: Wrap co_await in a target expr where needed [PR95050] Since the co_await expression is mostly opaque to the existing machinery, we were hiding the details of the await_resume return value. If that needs to be wrapped in a target expression, then emulate this with the whole co_await. Similarly, if the await expression we build in response to co_await p.yield_value (e) is wrapped in a target expression, then we need to transfer that wrapper to the resultant CO_YIELD_EXPR (which is, itself, just a proxy for the underlying co_await). gcc/cp/ChangeLog: PR c++/95050 * coroutines.cc (build_co_await): Wrap the co_await expression in a TARGET_EXPR, where needed. (finish_co_yield_expr): Likewise. gcc/testsuite/ChangeLog: PR c++/95050 * g++.dg/coroutines/pr95050.C: New test.