coroutines: Implicitly movable objects should use move CTORs for co_return.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 16 May 2020 18:23:19 +0000 (19:23 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 16 May 2020 18:59:39 +0000 (19:59 +0100)
commit5ef067eb14d40337507077a8a1265a04daa8ebc1
treed4247ec8bedb4a0a57bf11c3c6b85787de9b9421
parentf5b461d453043c6b6dda50db0439e4c78b241f03
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.

gcc/cp/ChangeLog:

2020-05-16  Iain Sandoe  <iain@sandoe.co.uk>

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

gcc/testsuite/ChangeLog:

2020-05-16  Iain Sandoe  <iain@sandoe.co.uk>

* 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]