* [pushed] testsuite, coroutines : Mark final awaiters and co_await operators noexcept.
@ 2021-02-28 16:31 Iain Sandoe
0 siblings, 0 replies; only message in thread
From: Iain Sandoe @ 2021-02-28 16:31 UTC (permalink / raw)
To: GCC-patches
Hi,
Fixing up some non-conforming testcases.
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.
tested on x86_64-darwin, x86_64-linux-gnu
pushed to master,
thanks
Iain
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.
---
gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C | 8 ++++----
gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C | 6 +++---
gcc/testsuite/g++.dg/coroutines/pr95345.C | 6 +++---
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C b/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C
index e815ca70735..11bcce04b7d 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C
@@ -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 {};
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C b/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C
index c5fa65931e0..ce06cfddb0a 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C
@@ -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:
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95345.C b/gcc/testsuite/g++.dg/coroutines/pr95345.C
index 8eae611b8d3..57b95cbebb2 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95345.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95345.C
@@ -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 {}; }
--
2.24.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-28 16:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28 16:31 [pushed] testsuite, coroutines : Mark final awaiters and co_await operators noexcept Iain Sandoe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).