1 // RUN: %clang_cc1 -std=c++1z -fcoroutines-ts -verify %s -fcxx-exceptions -fexceptions -triple x86_64-windows-msvc -fms-extensions 2 namespace std::experimental { 3 template <typename... T> struct coroutine_traits; 4 // expected-note@-1{{declared here}} 5 6 template <class Promise = void> struct coroutine_handle { 7 coroutine_handle() = default; 8 static coroutine_handle from_address(void *) noexcept; 9 }; 10 template <> struct coroutine_handle<void> { 11 static coroutine_handle from_address(void *) noexcept; 12 coroutine_handle() = default; 13 template <class PromiseType> 14 coroutine_handle(coroutine_handle<PromiseType>) noexcept; 15 }; 16 } // namespace std::experimental 17 18 struct suspend_always { 19 bool await_ready() noexcept; 20 void await_suspend(std::experimental::coroutine_handle<>) noexcept; 21 void await_resume() noexcept; 22 }; 23 24 template <> struct std::experimental::coroutine_traits<void> { 25 struct promise_type { 26 void get_return_object() noexcept; 27 suspend_always initial_suspend() noexcept; 28 suspend_always final_suspend() noexcept; 29 void return_void() noexcept; 30 void unhandled_exception() noexcept; 31 }; 32 }; 33 SEH_used()34void SEH_used() { 35 __try { // expected-error {{cannot use SEH '__try' in a coroutine when C++ exceptions are enabled}} 36 co_return; // expected-note {{function is a coroutine due to use of 'co_return' here}} 37 // expected-warning@-1 {{support for std::experimental::coroutine_traits will be removed}} 38 } __except (0) { 39 } 40 } 41