1 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts -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
6 namespace experimental {
8 template <class Ret, typename... T>
9 struct coroutine_traits { using promise_type = typename Ret::promise_type; };
11 template <class Promise = void>
12 struct coroutine_handle {
13 static coroutine_handle from_address(void *);
16 struct coroutine_handle<void> {
17 template <class PromiseType>
18 coroutine_handle(coroutine_handle<PromiseType>);
19 static coroutine_handle from_address(void *);
22 struct suspend_always {
23 bool await_ready() { return false; }
24 void await_suspend(coroutine_handle<>) {}
25 void await_resume() {}
28 struct suspend_never {
29 bool await_ready() { return true; }
30 void await_suspend(coroutine_handle<>) {}
31 void await_resume() {}
34 } // namespace experimental
37 #endif // STD_COROUTINE_H