https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105475
Arsen Arsenović <arsen at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arsen at gcc dot gnu.org --- Comment #2 from Arsen Arsenović <arsen at gcc dot gnu.org> --- unsure if this code is valid.. anyway, the crash reason is the lack of default in coroutine_handle. we pass a NULL_TREE promise type to instantiate_coro_handle_for_promise_type in order to instantiate the type-erased coro handle and the compiler gets confused: /* We can also instantiate the void coroutine_handle<> */ void_coro_handle_type = instantiate_coro_handle_for_promise_type (loc, NULL_TREE); if (void_coro_handle_type == NULL_TREE) return false; passing void_type_note there fixes that crash and reveals another in fold_builtin_call_array (so, it could be something else, I'll get back to that later - I suspect (not too confidently) that it might be unrelated)