[Bug c++/95050] coroutine: no "mandatory copy elision" for prvalue await_resume expression.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95050 Iain Sandoe changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |iains at gcc dot gnu.org Target Milestone|--- |10.2 Last reconfirmed||2020-05-14 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
[Bug c++/95050] coroutine: no "mandatory copy elision" for prvalue await_resume expression.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95050 --- Comment #1 from CVS Commits --- The master branch has been updated by Iain D Sandoe : https://gcc.gnu.org/g:324276ff9b1aa5128e5cb9f5d43182d1ebab0752 commit r11-835-g324276ff9b1aa5128e5cb9f5d43182d1ebab0752 Author: Iain Sandoe 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.
[Bug c++/95050] coroutine: no "mandatory copy elision" for prvalue await_resume expression.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95050 --- Comment #2 from CVS Commits --- The releases/gcc-10 branch has been updated by Iain D Sandoe : https://gcc.gnu.org/g:ac9b05305d376cfa391dd57a46515cbdc165f094 commit r10-8261-gac9b05305d376cfa391dd57a46515cbdc165f094 Author: Iain Sandoe Date: Sun Jun 7 13: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. (cherry picked from commit 324276ff9b1aa5128e5cb9f5d43182d1ebab0752)
[Bug c++/95050] coroutine: no "mandatory copy elision" for prvalue await_resume expression.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95050 Iain Sandoe changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #3 from Iain Sandoe --- fixed on master and for 10.2