]> git.ipfire.org Git - thirdparty/gcc.git/commit
coroutines: Implicitly movable objects should use move CTORs for co_return.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 24 May 2020 11:09:10 +0000 (12:09 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 24 May 2020 11:09:34 +0000 (12:09 +0100)
commit135c679c34902fe2bdb0f7b19eace28e1b783eba
treedf9e770aeaaa9e07f984a38c8cda93aaa1ab9d58
parent647f3c4a3a2726ff32690965eaf9ac6c5548ac85
coroutines: Implicitly movable objects should use move CTORs for co_return.

This is a case where the standard contains conflicting information.
after discussion between implementators, the accepted intent is of
[class.copy.elision].  This amends the handling of co_return statements
to follow that.

Backport 5ef067eb14d40337507077a8a1265a04daa8ebc1 and f898793b4545483adaf62c5efbc78cee518884e6

gcc/cp/ChangeLog:

* coroutines.cc (finish_co_return_stmt): Implement rules
from [class.copy.elision] /3.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/co-return-syntax-10-movable.C: New test.
gcc/cp/ChangeLog
gcc/cp/coroutines.cc
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C [new file with mode: 0644]