[PATCH] coroutines: Fix handling of non-class coroutine returns [PR94759]

Nathan Sidwell nathan@acm.org
Mon Apr 27 13:49:21 GMT 2020


On 4/25/20 9:49 AM, Iain Sandoe wrote:
> Hi

> 
> tested on x86_64-darwin,
> OK for master if the testing passes regstrap on x86-64-linux?
> thanks
> Iain
> 
> gcc/cp/ChangeLog:
> 
> 2020-04-23  Iain Sandoe  <iain@sandoe.co.uk>
> 
> 	PR c++/94759
> 	* coroutines.cc (coro_promise_type_found_p): Do not
> 	exclude non-classes here (this needs to be handled in the
> 	coroutine header).
> 	(morph_fn_to_coro):  Allow for the case where the coroutine
> 	returns void.

Ok, A nit ..

> @@ -4197,16 +4183,24 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
>     /* The ramp is done, we just need the return value.  */
>     if (!same_type_p (TREE_TYPE (get_ro), fn_return_type))
>       {
> -      /* construct the return value with a single GRO param.  */

>         r = build_cplus_new (fn_return_type, r, tf_warning_or_error);
>       }
> -  else
> +  else if (!gro_is_void_p)
>       r = rvalue (gro); /* The GRO is the return value.  */
> +  else r = NULL_TREE;

^^ missing line break

I see Jonathan approved the library bit, with a nit too.

nathan

-- 
Nathan Sidwell


More information about the Libstdc++ mailing list