https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95517
mengjun wei <wei_mj at 139 dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wei_mj at 139 dot com --- Comment #4 from mengjun wei <wei_mj at 139 dot com> --- GCC 11.2 no longer allow return_value and return_void be both defined, may this restriction be removed? This makes the co_return statement necessary: CTask workflow_work(CTaskScheduler::RawPtr scheduler, co_comm_ctx::co_comm_workflow* workflow, const char* buf, int len) { co_comm_resp_impl::ptr response(new co_comm_resp_impl); co_await co_comm_ctx::short_req_task::create(workflow, 1, buf, len, response); co_await co_comm_ctx::short_req_task::create(workflow, 2, buf, len, response); co_await co_comm_ctx::resp_task::create(workflow, response->result.c_str(), response->result.length()); co_return 0; }