https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97561
Bug ID: 97561
Summary: coroutine_handle doesn't have inheritance
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: stinkingmadgod at gmail dot com
Target Milestone: ---
std::coroutine_handle<promise_type> doesn't inherit from
std::coroutine_handle<void>.
[coroutine.handle.general]
template<class Promise>
struct coroutine_handle : coroutine_handle<>
#include<coroutine>
struct task {
struct promise_type {
task get_return_object() { return {}; }
std::suspend_never initial_suspend() { return {}; }
std::suspend_never final_suspend() { return {}; }
void return_void() {}
void unhandled_exception() {}
};
};
int main()
{
std::coroutine_handle<task::promise_type> c;
std::coroutine_handle<>& c2 = c; // fails
}