1 // RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -std=c++17 -fcoroutines-ts %s
3 // expected-no-diagnostics
6 template <typename _Result
, typename
...>
7 struct coroutine_traits
{
8 using promise_type
= typename
_Result::promise_type
;
11 template <typename _Promise
= void>
12 struct coroutine_handle
;
15 struct coroutine_handle
<void> {
16 static coroutine_handle
from_address(void *__a
) noexcept
;
17 void resume() const noexcept
;
18 void destroy() const noexcept
;
21 template <typename _Promise
>
22 struct coroutine_handle
: coroutine_handle
<> {};
24 struct suspend_always
{
25 bool await_ready() const noexcept
;
26 void await_suspend(coroutine_handle
<>) const noexcept
;
27 void await_resume() const noexcept
;
35 std::suspend_always
initial_suspend() noexcept
;
36 std::suspend_always
final_suspend() noexcept
;
38 Task
get_return_object() noexcept
;
39 void unhandled_exception() noexcept
;
40 void return_value(int value
) noexcept
;
42 std::suspend_always
yield_value(int value
) noexcept
;
48 co_yield({ int frame
= 0; 0; });
49 co_await({ int frame
= 0; std::suspend_always(); });
50 co_return({ int frame
= 0; 0; });