coroutines: Handle bad g-r-o-o-a-f cases.
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 26 Jun 2020 09:52:07 +0000 (10:52 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 26 Jun 2020 11:40:16 +0000 (12:40 +0100)
commite195c8045a1f3604f0f6b339e9ff731ebd9dcb0e
tree7fb5eb0074fd3aa582864d0ffd646dd86a623679
parent5b959c22bc0158faa359a5899bf46e815dc65290
coroutines: Handle bad g-r-o-o-a-f cases.

If we see a get_return_object_on_allocation_failure in the
promise, we expect to be able to use it.  If this isn't
possible (because of some error in the declaration) then we
need to handle the erroneous return to allow following code
to complete.

gcc/cp/ChangeLog:

* coroutines.cc (morph_fn_to_coro): Handle error
returns in building g-r-o-o-a-f expressions.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/coro1-allocators.h (BAD_GROOAF_STATIC):
New.
* g++.dg/coroutines/coro-bad-grooaf-00-static.C: New test.
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/coro-bad-grooaf-00-static.C [new file with mode: 0644]
gcc/testsuite/g++.dg/coroutines/coro1-allocators.h