diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2020-06-23 10:06:21 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2020-06-23 18:37:42 +0100 |
commit | 788b962aa00959e861b45767c5c88ec41ca30c21 (patch) | |
tree | ca5baf402ff7008dc7ed672f0c6ff906623863c0 /gcc/config.gcc | |
parent | 17964eb3a054c634b743aae9d1d9414e1bf21885 (diff) | |
download | gcc-788b962aa00959e861b45767c5c88ec41ca30c21.zip gcc-788b962aa00959e861b45767c5c88ec41ca30c21.tar.gz gcc-788b962aa00959e861b45767c5c88ec41ca30c21.tar.bz2 |
coroutines: Add a cleanup expression for g-r-o when needed [PR95477].
The PR reports that we fail to destroy the object initially created from
the get-return-object call. Fixed by adding a cleanup when the DTOR is
non-trivial. In addition, to meet the specific wording that the call to
get_return_object creates the glvalue for the return, we must construct
that in-place in the return object to avoid a second copy/move CTOR.
gcc/cp/ChangeLog:
PR c++/95477
* coroutines.cc (morph_fn_to_coro): Apply a cleanup to
the get return object when the DTOR is non-trivial.
gcc/testsuite/ChangeLog:
PR c++/95477
* g++.dg/coroutines/pr95477.C: New test.
* g++.dg/coroutines/void-gro-non-class-coro.C: New test.
Diffstat (limited to 'gcc/config.gcc')
0 files changed, 0 insertions, 0 deletions