// { dg-additional-options "-fsyntax-only" } // { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } #include #include template struct promise { struct final_awaitable { bool await_ready() noexcept; template std::coroutine_handle<> await_suspend(std::coroutine_handle) noexcept; void await_resume() noexcept; }; auto get_return_object() { return std::coroutine_handle::from_promise(*this); } auto initial_suspend() { return std::suspend_always(); } auto final_suspend() noexcept { return true; } void unhandled_exception(); }; template struct task { using promise_type = promise; task(std::coroutine_handle>); bool await_ready(); std::coroutine_handle<> await_suspend(std::coroutine_handle<>); T await_resume(); }; task> foo() { while ((co_await foo()).empty()) ; } // { dg-error {'final_suspend\(\)' awaitable type 'bool' is not a structure} }