[Bug c++/116880] [15 Regression] too early coroutine destruction of co_await on nix-2.24.8
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 3 22:03:43 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116880
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:4c743798b1d4530b327dad7c606c610f3811fdbf
commit r15-7338-g4c743798b1d4530b327dad7c606c610f3811fdbf
Author: Iain Sandoe <iains.gcc@gmail.com>
Date: Thu Oct 31 08:40:08 2024 +0000
c++/coroutines: Fix awaiter var creation [PR116506]
Awaiters always need to have a coroutine state frame copy since
they persist across potential supensions. It simplifies the later
analysis considerably to assign these early which we do when
building co_await expressions.
The cleanups in r15-3146-g47dbd69b1, unfortunately elided some of
processing used to cater for cases where the var created from an
xvalue, or is a pointer/reference type.
Corrected thus.
PR c++/116506
PR c++/116880
gcc/cp/ChangeLog:
* coroutines.cc (build_co_await): Ensure that xvalues are
materialised. Handle references/pointer values in awaiter
access expressions.
(is_stable_lvalue): New.
* decl.cc (cxx_maybe_build_cleanup): Handle null arg.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/pr116506.C: New test.
* g++.dg/coroutines/pr116880.C: New test.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
Co-authored-by: Jason Merrill <jason@redhat.com>
More information about the Gcc-bugs
mailing list