coroutines: Pass class ref to traits lookup and promise allocator [PR94760].
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 28 Apr 2020 01:15:07 +0000 (02:15 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 28 Apr 2020 01:16:34 +0000 (02:16 +0100)
commitf5edc76acac7bbadd8d1b00c4cc5994b2a088542
tree4eef2f6a4876fa7ba9a50138918e58e69d295212
parentb9c91b7f3279e23aed965c05197acf3b6f439f8d
coroutines: Pass class ref to traits lookup and promise allocator [PR94760].

We changed the argument passed to the promise parameter preview
to match a reference to *this.  However to be consistent with the
other ports, we do need to match the reference transformation in
the traits lookup and the promise allocator lookup.

gcc/cp/ChangeLog:

2020-04-28  Iain Sandoe  <iain@sandoe.co.uk>

PR c++/94760
* coroutines.cc (instantiate_coro_traits): Pass a reference to
object type rather than a pointer type for 'this', for method
coroutines.
(struct param_info): Add a field to hold that the parm is a lambda
closure pointer.
(morph_fn_to_coro): Check for lambda closure pointers in the
args.  Use a reference to *this when building the args list for the
promise allocator lookup.

gcc/testsuite/ChangeLog:

2020-04-28  Iain Sandoe  <iain@sandoe.co.uk>

PR c++/94760
* g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C:
New test.
gcc/cp/ChangeLog
gcc/cp/coroutines.cc
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/coroutines/pr9xxxx-mismatched-traits-and-promise-prev.C [new file with mode: 0644]