1 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value 2 #ifndef STD_COROUTINE_H 3 #define STD_COROUTINE_H 4 5 namespace std { 6 7 template <class Ret, typename... T> 8 struct coroutine_traits { using promise_type = typename Ret::promise_type; }; 9 10 template <class Promise = void> 11 struct coroutine_handle { 12 static coroutine_handle from_address(void *) noexcept; 13 }; 14 template <> 15 struct coroutine_handle<void> { 16 template <class PromiseType> 17 coroutine_handle(coroutine_handle<PromiseType>) noexcept; 18 static coroutine_handle from_address(void *); 19 }; 20 21 struct suspend_always { 22 bool await_ready() noexcept { return false; } 23 void await_suspend(coroutine_handle<>) noexcept {} 24 void await_resume() noexcept {} 25 }; 26 27 struct suspend_never { 28 bool await_ready() noexcept { return true; } 29 void await_suspend(coroutine_handle<>) noexcept {} 30 void await_resume() noexcept {} 31 }; 32 33 } // namespace std 34 35 #endif // STD_COROUTINE_H 36