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.
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 {};
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:
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 {}; }