1 // This file is to test the mixed use of `std::experimental::coroutine*` and `std::coroutine*`
2 // wouldn't make the compiler to crash and emit the diagnostic message correctly.
3 // RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s
5 #include "Inputs/std-coroutine-exp-namespace.h"
6 #include "Inputs/std-coroutine.h" // Second
9 bool await_ready() noexcept
;
10 void await_suspend(std::experimental::coroutine_handle
<> coro
) noexcept
;
11 void await_resume() noexcept
;
15 void get_return_object();
16 my_awaitable
initial_suspend();
17 my_awaitable
final_suspend() noexcept
;
19 void unhandled_exception();
23 struct std::coroutine_traits
<void> { using promise_type
= promise_void
; };
26 co_return
; // expected-error {{mixed use of std and std::experimental namespaces for coroutine components}}
27 // expected-warning@-1{{support for 'std::experimental::coroutine_traits' will be removed}}
28 // expected-note@Inputs/std-coroutine-exp-namespace.h:8 {{'coroutine_traits' declared here}}
29 // expected-note@Inputs/std-coroutine.h:18 {{'coroutine_traits' declared here}}