1 // RUN: %clang_cc1 -std=c++20 -verify %s -fcxx-exceptions -fexceptions -triple x86_64-windows-msvc -fms-extensions
3 template <typename
... T
> struct coroutine_traits
;
5 template <class Promise
= void> struct coroutine_handle
{
6 coroutine_handle() = default;
7 static coroutine_handle
from_address(void *) noexcept
;
9 template <> struct coroutine_handle
<void> {
10 static coroutine_handle
from_address(void *) noexcept
;
11 coroutine_handle() = default;
12 template <class PromiseType
>
13 coroutine_handle(coroutine_handle
<PromiseType
>) noexcept
;
17 struct suspend_always
{
18 bool await_ready() noexcept
;
19 void await_suspend(std::coroutine_handle
<>) noexcept
;
20 void await_resume() noexcept
;
23 template <> struct std::coroutine_traits
<void> {
25 void get_return_object() noexcept
;
26 suspend_always
initial_suspend() noexcept
;
27 suspend_always
final_suspend() noexcept
;
28 void return_void() noexcept
;
29 void unhandled_exception() noexcept
;
34 __try
{ // expected-error {{cannot use SEH '__try' in a coroutine when C++ exceptions are enabled}}
35 co_return
; // expected-note {{function is a coroutine due to use of 'co_return' here}}