mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-21 19:51:23 +08:00
testsuite, coroutines : Mark final awaiters and co_await operators noexcept.
This is part of the requirement of [dcl.fct.def.coroutine]/15. In addition to promise final_suspend() calls, the following cases must also be noexcept as per discussion in PR95616. - finalSuspendObj.operator co_await() - finalSuspendAwaiter.await_ready() - finalSuspendAwaiter.await_suspend() - finalSuspendAwaiter.await_resume() - finalSuspedObj destructor - finalSuspendAwaiter destructor Fixed for missing cases in the testsuite as a prerequisite to fixing PR95616. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr94879-folly-1.C: Make final suspend expression components noexcept. * g++.dg/coroutines/pr94883-folly-2.C: Likewise. * g++.dg/coroutines/pr95345.C: Likewise.
This commit is contained in:
parent
7e5d7fc7e6
commit
3c173f7890
@ -18,14 +18,14 @@ class i {
|
||||
namespace ac {
|
||||
template <typename> class ad {
|
||||
public:
|
||||
bool await_ready();
|
||||
void await_resume();
|
||||
void await_suspend(std::coroutine_handle<>);
|
||||
bool await_ready() noexcept;
|
||||
void await_resume() noexcept;
|
||||
void await_suspend(std::coroutine_handle<>) noexcept;
|
||||
i ae;
|
||||
};
|
||||
} // namespace ac
|
||||
|
||||
template <typename ab> ac::ad<ab> operator co_await(ab);
|
||||
template <typename ab> ac::ad<ab> operator co_await(ab) noexcept;
|
||||
class j {
|
||||
class l {};
|
||||
|
||||
|
@ -16,9 +16,9 @@ int f;
|
||||
class h {
|
||||
class j {
|
||||
public:
|
||||
bool await_ready();
|
||||
void await_suspend(std::coroutine_handle<>);
|
||||
void await_resume();
|
||||
bool await_ready() noexcept;
|
||||
void await_suspend(std::coroutine_handle<>) noexcept;
|
||||
void await_resume() noexcept;
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -9,9 +9,9 @@ using namespace std::experimental;
|
||||
struct dummy_coro
|
||||
{
|
||||
using promise_type = dummy_coro;
|
||||
bool await_ready() { return false; }
|
||||
void await_suspend(std::coroutine_handle<>) { }
|
||||
void await_resume() { }
|
||||
bool await_ready() noexcept { return false; }
|
||||
void await_suspend(std::coroutine_handle<>) noexcept { }
|
||||
void await_resume() noexcept { }
|
||||
dummy_coro get_return_object() { return {}; }
|
||||
dummy_coro initial_suspend() { return {}; }
|
||||
dummy_coro final_suspend() noexcept { return {}; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user