https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121643
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <[email protected]>: https://gcc.gnu.org/g:3bf1ba4c723b8fd6274fb134890c83031d00d408 commit r16-8676-g3bf1ba4c723b8fd6274fb134890c83031d00d408 Author: Jason Merrill <[email protected]> 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). The change to pr105287.C is needed because that test now correctly calls operator coroutine_handle<>(), and that addition confuses the analyzer into thinking there's a use-after-free problem. Since the analyzer is known to have a lot of trouble with coroutines (PR105382), let's ignore the new false positive and just check that the test doesn't ICE. 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/pr105287.C: Add dg-excess-errors. * g++.dg/coroutines/pr121643.C: New test. * g++.dg/coroutines/pr123975.C: New test.
