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
4 
5 namespace std {
6 namespace experimental {
7 
8 template <class Ret, typename... T>
9 struct coroutine_traits { using promise_type = typename Ret::promise_type; };
10 
11 template <class Promise = void>
12 struct coroutine_handle {
13   static coroutine_handle from_address(void *) noexcept;
14 };
15 template <>
16 struct coroutine_handle<void> {
17   template <class PromiseType>
18   coroutine_handle(coroutine_handle<PromiseType>) noexcept;
19   static coroutine_handle from_address(void *);
20 };
21 
22 struct suspend_always {
23   bool await_ready() noexcept { return false; }
24   void await_suspend(coroutine_handle<>) noexcept {}
25   void await_resume() noexcept {}
26 };
27 
28 struct suspend_never {
29   bool await_ready() noexcept { return true; }
30   void await_suspend(coroutine_handle<>) noexcept {}
31   void await_resume() noexcept {}
32 };
33 
34 } // namespace experimental
35 } // namespace std
36 
37 #endif // STD_COROUTINE_H
38