// { dg-additional-options "-Wall -O" } // This should complete without any diagnostic. #include #include template class lazy { T _v = 0; public: lazy() {} bool await_ready() {return true;} void await_suspend(auto x) noexcept {} T await_resume() { return _v; } }; namespace std { template struct coroutine_traits, Args...> { struct promise_type { suspend_always initial_suspend() const { return {}; } suspend_always final_suspend() const noexcept { return {}; } void return_value(T val) {} lazy get_return_object() { return lazy(); } void unhandled_exception() { std::terminate(); } }; }; } struct xxx { static lazy func() { co_return 1; } }; #if 0 lazy foo() { co_return co_await xxx::func(); } #endif