// PR c++/115550 - wrong deduction when passing *this to promise ctor template #include template struct remove_reference { using type = T; }; template struct remove_reference { using type = T; }; template struct remove_reference { using type = T; }; template using remove_reference_t = remove_reference::type; template struct is_same { static inline constexpr bool value = false; }; template struct is_same { static inline constexpr bool value = true; }; template concept same_as = is_same::value; struct coroutine { struct promise_type { template explicit promise_type(Arg&&) { static_assert(same_as< remove_reference_t>, remove_reference_t >); } coroutine get_return_object() { return {}; } std::suspend_never initial_suspend() noexcept { return {}; } std::suspend_never final_suspend() noexcept { return {}; } void return_void() {} void unhandled_exception() {throw;} }; }; struct x { coroutine f() { co_return; } };