[PATCH] coroutines: Handle initial awaiters with non-void returns [PR 100127].

Iain Sandoe iain@sandoe.co.uk
Fri Nov 19 17:40:44 GMT 2021


Hi Jason,

> On 18 Nov 2021, at 23:42, Iain Sandoe <iain@sandoe.co.uk> wrote:
> 
> 
> 
>> On 18 Nov 2021, at 22:13, Jason Merrill via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>> 
>> On 11/5/21 11:46, Iain Sandoe wrote:
>>> The way in which a C++20 coroutine is specified discards any value

>>> 	  tree aw_r = TREE_VEC_ELT (vec, 2);
>>> +	  if (!VOID_TYPE_P (TREE_TYPE (aw_r)))
>>> +	    aw_r = build1 (CONVERT_EXPR, void_type_node, aw_r);
>> 
>> Is there a reason not to use convert_to_void?
> 
> no, just me still learning APIs… I’ll do a revised and check it.

So I’m testing this replacement:

	  aw_r = convert_to_void (aw_r, ICV_CAST, tf_warning_or_error);

OK if the testing succeeds?
Iain



More information about the Gcc-patches mailing list