Re: [PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-25 Thread Jason Merrill
On 7/24/24 4:52 PM, Arsen Arsenović wrote: Jason Merrill writes: Ah, of course, I was overlooking the assignment. The patch is OK. Thanks. Here's a range diff with a few changes to the commits, chiefly in the commit messages. If you agree, I can push with these changes applied: Looks go

Re: [PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-24 Thread Arsen Arsenović
Jason Merrill writes: > Ah, of course, I was overlooking the assignment. The patch is OK. Thanks. Here's a range diff with a few changes to the commits, chiefly in the commit messages. If you agree, I can push with these changes applied: 1: 32f810cca55 ! 1: d2e74525965 cp/coroutines: do no

Re: [PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-24 Thread Jason Merrill
On 7/24/24 4:20 PM, Arsen Arsenović wrote: Hi Jason, Thanks for the review. Jason Merrill writes: On 7/23/24 7:41 PM, Arsen Arsenović wrote: co_await expressions are nearly calls to Awaitable::await_resume, and, as such, should inherit its nodiscard. A discarded co_await expression should,

Re: [PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-24 Thread Arsen Arsenović
Hi Jason, Thanks for the review. Jason Merrill writes: > On 7/23/24 7:41 PM, Arsen Arsenović wrote: >> co_await expressions are nearly calls to Awaitable::await_resume, and, >> as such, should inherit its nodiscard. A discarded co_await expression >> should, hence, act as if its call to await_

Re: [PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-24 Thread Jason Merrill
On 7/23/24 7:41 PM, Arsen Arsenović wrote: co_await expressions are nearly calls to Awaitable::await_resume, and, as such, should inherit its nodiscard. A discarded co_await expression should, hence, act as if its call to await_resume was discarded. CO_AWAIT_EXPR trees do conveniently contain t

[PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-23 Thread Arsen Arsenović
co_await expressions are nearly calls to Awaitable::await_resume, and, as such, should inherit its nodiscard. A discarded co_await expression should, hence, act as if its call to await_resume was discarded. CO_AWAIT_EXPR trees do conveniently contain the expression for calling await_resume in the