[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaCXX / coroutine-mixed4-exp-namespace.cpp
blobb09482d5b426b7dc25549a26d2cec7a77f51ef72
1 // RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s
3 #include "Inputs/std-coroutine.h"
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
11 struct my_awaitable {
12 bool await_ready() noexcept;
13 void await_suspend(std::experimental::coroutine_handle<> coro) noexcept;
14 void await_resume() noexcept;
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();
25 template <>
26 struct std::coroutine_traits<void> { using promise_type = promise_void; };
28 void 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:18 {{'coroutine_traits' declared here}}