public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@sandoe.co.uk>
To: GCC-patches@gcc.gnu.org
Subject: [pushed] testsuite, coroutines : Mark final awaiters and co_await  operators noexcept.
Date: Sun, 28 Feb 2021 16:31:30 +0000	[thread overview]
Message-ID: <F8FBAB93-4E04-4A4F-957B-B3627872B896@sandoe.co.uk> (raw)

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


                 reply	other threads:[~2021-02-28 16:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F8FBAB93-4E04-4A4F-957B-B3627872B896@sandoe.co.uk \
    --to=iain@sandoe.co.uk \
    --cc=GCC-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).