[Bug c++/123975] [15/16 Regression] Crash when await_suspend takes an r-value (&&) argument
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 15 19:24:09 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123975
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:95fb3cdf169b49393e386a2b9042803d944dfe8e
commit r15-11086-g95fb3cdf169b49393e386a2b9042803d944dfe8e
Author: Jason Merrill <jason@redhat.com>
Date: Tue Apr 14 19:19:37 2026 -0400
c++: unusual await_suspend parameters [PR123975]
expand_one_await_expression was assuming we could replace the last argument
of await_suspend with a call to handle::from_address. This is wrong if
either the handle parameter has a different type (123975) or await_suspend
has additional parameters (121643).
PR c++/121643
PR c++/123975
gcc/cp/ChangeLog:
* coroutines.cc (build_co_await): Pass rvalue to await_suspend.
(expand_one_await_expression): Fix await_suspend surgery.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/pr121643.C: New test.
* g++.dg/coroutines/pr123975.C: New test.
(cherry picked from commit 3bf1ba4c723b8fd6274fb134890c83031d00d408)
More information about the Gcc-bugs
mailing list