1 // RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s 2 3 #include "Inputs/std-coroutine.h" 4 5 namespace std::experimental { 6 // expected-note@+1{{declared here}} 7 template <typename T> using coroutine_traits = std::coroutine_traits<T>; 8 using std::coroutine_handle; 9 } // namespace std::experimental 10 11 struct my_awaitable { 12 bool await_ready() noexcept; 13 void await_suspend(std::experimental::coroutine_handle<> coro) noexcept; 14 void await_resume() noexcept; 15 }; 16 17 struct promise_void { 18 void get_return_object(); 19 my_awaitable initial_suspend(); 20 my_awaitable final_suspend() noexcept; 21 void return_void(); 22 void unhandled_exception(); 23 }; 24 25 template <> 26 struct std::coroutine_traits<void> { using promise_type = promise_void; }; 27 test()28void test() { 29 co_return; // expected-error {{mixed use of std and std::experimental namespaces for coroutine components}} 30 // expected-warning@-1{{support for std::experimental::coroutine_traits will be removed}} 31 // expected-note@Inputs/std-coroutine.h:8 {{'coroutine_traits' declared here}} 32 } 33