// { dg-additional-options "-fsyntax-only" } // { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } #include template struct promise { auto get_return_object() { return std::coroutine_handle::from_promise(*this); } auto initial_suspend() { return 42.0; } auto final_suspend() noexcept { return true; } void unhandled_exception(); void return_void (); }; 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() { // { dg-error {'initial_suspend\(\)' awaitable type 'double' is not a structure} } co_return; }