coroutines: Pass class reference to promise param preview [PR94682]
As reported in the PR, per [dcl.fct.def.coroutine]/4 we should
be passing a reference to the object to the promise parameter
preview, and we are currently passing a pointer (this). Amend to
pass the reference.
gcc/cp/ChangeLog:
2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94682
* coroutines.cc (struct param_info): Add a field to note that
the param is 'this'.
(morph_fn_to_coro): Convert this to a reference before using it
in the promise parameter preview.
gcc/testsuite/ChangeLog:
2020-04-22 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94682
* g++.dg/coroutines/pr94682-preview-this.C: New test.