[libcxx tests] Clang is more strict now about coroutines

As of 516803dc86, clang is now more
strictly enforcing the coroutine specification.

See: https://reviews.llvm.org/D82029
This commit is contained in:
David Zarzycki 2020-06-23 06:48:02 -04:00
parent 7ab05d9a60
commit f3f016dbaa
9 changed files with 9 additions and 9 deletions

View File

@ -25,7 +25,7 @@ struct MyFuture {
struct promise_type {
typedef coro::coroutine_handle<promise_type> HandleT;
coro::suspend_never initial_suspend() { return sn; }
coro::suspend_always final_suspend() { return sa; }
coro::suspend_always final_suspend() noexcept { return sa; }
coro::suspend_never yield_value(int) { return sn; }
MyFuture get_return_object() {
MyFuture f(HandleT::from_promise(*this));

View File

@ -32,7 +32,7 @@ struct MyCoro {
void unhandled_exception() {}
void return_void() {}
coro::suspend_never initial_suspend() { return {}; }
coro::suspend_never final_suspend() { return {}; }
coro::suspend_never final_suspend() noexcept { return {}; }
MyCoro get_return_object() {
do_runtime_test();
return {};

View File

@ -23,7 +23,7 @@ struct coro_t {
return {};
}
suspend_never initial_suspend() { return {}; }
suspend_never final_suspend() { return {}; }
suspend_never final_suspend() noexcept { return {}; }
void return_void() {}
static void unhandled_exception() {}
};

View File

@ -25,7 +25,7 @@ struct coro_t {
return coroutine_handle<promise_type>::from_promise(*this);
}
suspend_never initial_suspend() { return {}; }
suspend_never final_suspend() { return {}; }
suspend_never final_suspend() noexcept { return {}; }
void return_void() {}
void unhandled_exception() {}
};

View File

@ -40,7 +40,7 @@ struct expected {
Data* data;
DataPtr get_return_object() { data = new Data{}; return {data}; }
suspend_never initial_suspend() { return {}; }
suspend_never final_suspend() { return {}; }
suspend_never final_suspend() noexcept { return {}; }
void return_value(T v) { data->val = std::move(v); data->error = {};}
void unhandled_exception() {}
};

View File

@ -45,7 +45,7 @@ struct Bug {
struct coro2 {
struct promise_type {
suspend_never initial_suspend() { return{}; }
suspend_never final_suspend() { return{}; }
suspend_never final_suspend() noexcept { return{}; }
coro2 get_return_object() { return{}; }
void return_void() {}
Bug yield_value(int) { return {}; }

View File

@ -29,7 +29,7 @@ struct minig {
return {};
}
suspend_always initial_suspend() { return {}; }
suspend_always final_suspend() { return {}; }
suspend_always final_suspend() noexcept { return {}; }
minig get_return_object() { return minig{this}; };
void return_void() {}
void unhandled_exception() {}

View File

@ -46,7 +46,7 @@ struct goroutine
suspend_never initial_suspend() {
return {};
}
suspend_never final_suspend() {
suspend_never final_suspend() noexcept {
return {};
}
void return_void() {}

View File

@ -20,7 +20,7 @@ template <typename Ty> struct generator {
return {};
}
std::experimental::suspend_always initial_suspend() { return {}; }
std::experimental::suspend_always final_suspend() { return {}; }
std::experimental::suspend_always final_suspend() noexcept { return {}; }
generator get_return_object() { return generator{this}; };
void return_void() {}
void unhandled_exception() {}