[pushed] testsuite, coroutines : Make final_suspend calls noexcept.

Message ID AAEEC301-2FA5-4165-AAF1-CC45D568D074@sandoe.co.uk
State New
Headers show
Series
  • [pushed] testsuite, coroutines : Make final_suspend calls noexcept.
Related show

Commit Message

Iain Sandoe Feb. 24, 2021, 7:26 p.m.
Hi,

The wording of [dcl.fct.def.coroutine]/15 states:
The expression co_await promise.final_suspend() shall not be
potentially-throwing.  A fair number of testcases are not correctly
marked. Fixed here.

mechanical patch,

tested on x86_64-darwin, x86-64-linux-gnu,
pushed as obvious
thanks
Iain

gcc/testsuite/ChangeLog:

	* g++.dg/coroutines/co-await-void_type.C: Mark promise
	final_suspend call as noexcept.
	* g++.dg/coroutines/co-return-syntax-08-bad-return.C: Likewise.
	* g++.dg/coroutines/co-return-syntax-10-movable.C: Likewise.
	* g++.dg/coroutines/co-return-warning-1.C: Likewise.
	* g++.dg/coroutines/co-yield-syntax-08-needs-expr.C: Likewise.
	* g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C: Likewise.
	* g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C: Likewise.
	* g++.dg/coroutines/coro-missing-gro.C: Likewise.
	* g++.dg/coroutines/coro-missing-promise-yield.C: Likewise.
	* g++.dg/coroutines/coro-missing-ret-value.C: Likewise.
	* g++.dg/coroutines/coro-missing-ret-void.C: Likewise.
	* g++.dg/coroutines/coro-missing-ueh.h: Likewise.
	* g++.dg/coroutines/coro1-allocators.h: Likewise.
	* g++.dg/coroutines/coro1-refs-and-ctors.h: Likewise.
	* g++.dg/coroutines/coro1-ret-int-yield-int.h: Likewise.
	* g++.dg/coroutines/pr94682-preview-this.C: Likewise.
	* g++.dg/coroutines/pr94752.C: Likewise.
	* g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C: Likewise.
	* g++.dg/coroutines/pr94879-folly-1.C: Likewise.
	* g++.dg/coroutines/pr94883-folly-2.C: Likewise.
	* g++.dg/coroutines/pr95050.C: Likewise.
	* g++.dg/coroutines/pr95345.C: Likewise.
	* g++.dg/coroutines/pr95440.C: Likewise.
	* g++.dg/coroutines/pr95591.C: Likewise.
	* g++.dg/coroutines/pr95711.C: Likewise.
	* g++.dg/coroutines/pr95813.C: Likewise.
	* g++.dg/coroutines/symmetric-transfer-00-basic.C: Likewise.
	* g++.dg/coroutines/torture/co-await-07-tmpl.C: Likewise.
	* g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-15-default-return_void.C: Likewise.
	* g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: Likewise.
	* g++.dg/coroutines/torture/co-yield-00-triv.C: Likewise.
	* g++.dg/coroutines/torture/co-yield-03-tmpl.C: Likewise.
	* g++.dg/coroutines/torture/co-yield-04-complex-local-state.C: Likewise.
	* g++.dg/coroutines/torture/exceptions-test-0.C: Likewise.
	* g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C: Likewise.
	* g++.dg/coroutines/torture/func-params-04.C: Likewise.
	* g++.dg/coroutines/torture/local-var-06-structured-binding.C: Likewise.
	* g++.dg/coroutines/torture/mid-suspend-destruction-0.C: Likewise.
---
 gcc/testsuite/g++.dg/coroutines/co-await-void_type.C         | 2 +-
 .../g++.dg/coroutines/co-return-syntax-08-bad-return.C       | 2 +-
 .../g++.dg/coroutines/co-return-syntax-10-movable.C          | 2 +-
 gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C        | 2 +-
 .../g++.dg/coroutines/co-yield-syntax-08-needs-expr.C        | 2 +-
 .../coroutines/coro-bad-gro-00-class-gro-scalar-return.C     | 4 ++--
 .../coroutines/coro-bad-gro-01-void-gro-non-class-coro.C     | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C           | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C     | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C      | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h           | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro1-allocators.h           | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h       | 2 +-
 gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h    | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C       | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr94752.C                    | 2 +-
 .../coroutines/pr94760-mismatched-traits-and-promise-prev.C  | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C            | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C            | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr95050.C                    | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr95345.C                    | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr95440.C                    | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr95591.C                    | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr95711.C                    | 2 +-
 gcc/testsuite/g++.dg/coroutines/pr95813.C                    | 2 +-
 .../g++.dg/coroutines/symmetric-transfer-00-basic.C          | 2 +-
 gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C   | 2 +-
 .../g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C | 2 +-
 .../coroutines/torture/co-ret-00-void-return-is-ready.C      | 2 +-
 .../coroutines/torture/co-ret-01-void-return-is-suspend.C    | 2 +-
 .../g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C | 2 +-
 .../g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C        | 2 +-
 .../coroutines/torture/co-ret-06-template-promise-val-1.C    | 2 +-
 .../g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C  | 2 +-
 .../g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C    | 2 +-
 .../coroutines/torture/co-ret-15-default-return_void.C       | 2 +-
 .../g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C      | 2 +-
 gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C   | 2 +-
 gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C   | 2 +-
 .../coroutines/torture/co-yield-04-complex-local-state.C     | 2 +-
 gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C  | 2 +-
 .../g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C   | 2 +-
 gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C     | 5 +++--
 .../coroutines/torture/local-var-06-structured-binding.C     | 2 +-
 .../g++.dg/coroutines/torture/mid-suspend-destruction-0.C    | 2 +-
 46 files changed, 49 insertions(+), 48 deletions(-)

-- 
2.24.1

Patch

diff --git a/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C b/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C
index 0bb8818133e..370068fb5cb 100644
--- a/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C
+++ b/gcc/testsuite/g++.dg/coroutines/co-await-void_type.C
@@ -28,7 +28,7 @@  struct resumable::promise_type {
     return coro_handle::from_promise(*this);
   }
   auto initial_suspend() { return std::suspend_always(); }
-  auto final_suspend() { return std::suspend_always(); }
+  auto final_suspend() noexcept { return std::suspend_always(); }
   void yield_value(int v) { value_ = v; }
   void unhandled_exception() {}
 };
diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
index 9b537548791..148ee4543e8 100644
--- a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
+++ b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-08-bad-return.C
@@ -24,7 +24,7 @@  struct Coro {
   ~promise_type() {}
   Coro get_return_object () { return Coro (handle_type::from_promise (*this)); }
   auto initial_suspend () { return coro::suspend_always{}; }
-  auto final_suspend () { return coro::suspend_always{}; }
+  auto final_suspend () noexcept { return coro::suspend_always{}; }
   void return_void () { }
    void unhandled_exception() { }
   };
diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C
index c6f36a7143f..0cf3c394dc2 100644
--- a/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C
+++ b/gcc/testsuite/g++.dg/coroutines/co-return-syntax-10-movable.C
@@ -32,7 +32,7 @@  struct coro1 {
 
   auto get_return_object () { return handle_type::from_promise (*this);}
   coro::suspend_always initial_suspend () const { return {}; }
-  coro::suspend_always final_suspend () const {  return {}; }
+  coro::suspend_always final_suspend () const noexcept {  return {}; }
 
   void return_value(T&& v) noexcept { value = std::move(v); }
   void return_value(const T&) noexcept = delete;
diff --git a/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C b/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C
index 69e7690bb97..b2aaba15ae3 100644
--- a/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C
+++ b/gcc/testsuite/g++.dg/coroutines/co-return-warning-1.C
@@ -28,7 +28,7 @@  struct resumable::promise_type {
     return coro_handle::from_promise(*this);
   }
   auto initial_suspend() { return std::suspend_always(); }
-  auto final_suspend() { return std::suspend_always(); }
+  auto final_suspend() noexcept { return std::suspend_always(); }
   void return_value(int v) { value_ = v; }
   std::suspend_always yield_value(int v) {
     value_ = v;
diff --git a/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C b/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C
index 86969f781e4..aec1214db4a 100644
--- a/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C
+++ b/gcc/testsuite/g++.dg/coroutines/co-yield-syntax-08-needs-expr.C
@@ -10,7 +10,7 @@  struct DummyYield {
   DummyYield (coro::coroutine_handle<> handle) : handle (handle) {}
   struct dummy_yield {
     coro::suspend_never initial_suspend() { return {}; }
-    coro::suspend_never final_suspend() { return {}; }
+    coro::suspend_never final_suspend() noexcept { return {}; }
     DummyYield get_return_object() {
       return DummyYield (coro::coroutine_handle<dummy_yield>::from_promise (*this));
     }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C
index bd9dec6c75f..f9e8a5f398b 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C
@@ -21,11 +21,11 @@  struct std::coroutine_traits<R, HandleRef, T...> {
         }
 	~promise_type () { PRINT ("Destroyed Promise"); g_promise = 0;}
         Thing get_return_object() { return {}; }
-
+	//int get_return_object() { return 0; }
         auto initial_suspend() {
           return std::suspend_always{};
          }
-        auto final_suspend() { return std::suspend_never{}; }
+        auto final_suspend() noexcept { return std::suspend_never{}; }
 
         void return_void() {}
         void unhandled_exception() {}
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C
index c31fcb58b2e..2671ce7ca28 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C
@@ -19,7 +19,7 @@  struct std::coroutine_traits<R, HandleRef, T...> {
         auto initial_suspend() {
           return std::suspend_always{};
          }
-        auto final_suspend() { return std::suspend_never{}; }
+        auto final_suspend() noexcept { return std::suspend_never{}; }
 
         void return_void() {}
         void unhandled_exception() {}
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C
index fb02e9d5801..44a629b1386 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-gro.C
@@ -10,7 +10,7 @@  struct MissingGRO {
   MissingGRO (coro::coroutine_handle<> handle) : handle (handle) {}
   struct missing_gro {
     coro::suspend_never initial_suspend() { return {}; }
-    coro::suspend_never final_suspend() { return {}; }
+    coro::suspend_never final_suspend() noexcept { return {}; }
     void return_void () {}
     void unhandled_exception() { /*std::terminate();*/ };
   };
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C
index a85a4d54bbe..01cc41488e9 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-promise-yield.C
@@ -7,7 +7,7 @@  struct MissingPromiseYield {
   MissingPromiseYield (coro::coroutine_handle<> handle) : handle (handle) {}
   struct missing_yield {
     coro::suspend_never initial_suspend() { return {}; }
-    coro::suspend_never final_suspend() { return {}; }
+    coro::suspend_never final_suspend() noexcept { return {}; }
     MissingPromiseYield get_return_object() {
       return MissingPromiseYield (coro::coroutine_handle<missing_yield>::from_promise (*this));
     }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C
index f745fa9c852..91c29d34f33 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-value.C
@@ -10,7 +10,7 @@  struct MissingRetValue {
   MissingRetValue (coro::coroutine_handle<> handle) : handle (handle) {}
   struct missing_retvoid {
     coro::suspend_never initial_suspend() { return {}; }
-    coro::suspend_never final_suspend() { return {}; }
+    coro::suspend_never final_suspend() noexcept { return {}; }
     MissingRetValue get_return_object() {
       return MissingRetValue (coro::coroutine_handle<missing_retvoid>::from_promise (*this));
     }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C
index 8639a9d4f76..502391acc80 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ret-void.C
@@ -10,7 +10,7 @@  struct MissingRetVoid {
   MissingRetVoid (coro::coroutine_handle<> handle) : handle (handle) {}
   struct missing_retvoid {
     coro::suspend_never initial_suspend() { return {}; }
-    coro::suspend_never final_suspend() { return {}; }
+    coro::suspend_never final_suspend() noexcept { return {}; }
     MissingRetVoid get_return_object() {
       return MissingRetVoid (coro::coroutine_handle<missing_retvoid>::from_promise (*this));
     }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h b/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h
index 51e6135b8a7..361003ce04b 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro-missing-ueh.h
@@ -8,7 +8,7 @@  struct MissingUEH {
   MissingUEH (coro::coroutine_handle<> handle) : handle (handle) {}
   struct missing_ueh {
     coro::suspend_never initial_suspend() { return {}; }
-    coro::suspend_never final_suspend() { return {}; }
+    coro::suspend_never final_suspend() noexcept { return {}; }
     MissingUEH get_return_object() {
       return MissingUEH (coro::coroutine_handle<missing_ueh>::from_promise (*this));
     }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h b/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h
index f7a85e9e671..cf73dc09ef7 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro1-allocators.h
@@ -100,7 +100,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h b/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h
index 5b89e7c4128..8831a07875e 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro1-refs-and-ctors.h
@@ -19,7 +19,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h b/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h
index 7cf50525924..826519e8a46 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro1-ret-int-yield-int.h
@@ -108,7 +108,7 @@  struct coro1 {
 #endif
 #ifdef MISSING_FINAL_SUSPEND
 #else
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C b/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C
index ca96f373da2..7c4bae2af19 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94682-preview-this.C
@@ -13,7 +13,7 @@  struct promise
   promise(Class &,int) { static_assert(!std::is_pointer<Class>::value, ""); }
 
   coro::suspend_never initial_suspend() { return {}; }
-  coro::suspend_never final_suspend() { return {}; }
+  coro::suspend_never final_suspend() noexcept { return {}; }
 
   future get_return_object() { return {}; }
 
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94752.C b/gcc/testsuite/g++.dg/coroutines/pr94752.C
index 89ace6a6bff..e5e4ece4bd7 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr94752.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94752.C
@@ -9,7 +9,7 @@  struct task {
         promise_type() {}
         task get_return_object() { return {}; }
         suspend_never initial_suspend() { return {}; }
-        suspend_never final_suspend() { return {}; }
+        suspend_never final_suspend() noexcept { return {}; }
         void return_void() {}
         void unhandled_exception() {}
     };
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C b/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C
index 235b5e757be..90a558d0fe2 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94760-mismatched-traits-and-promise-prev.C
@@ -14,7 +14,7 @@  struct std::coroutine_traits<R, CallOp, T...> {
         promise_type (CallOp op, T ...args) {}
         Fake get_return_object() { return {}; }
         std::suspend_always initial_suspend() { return {}; }
-        std::suspend_never final_suspend() { return {}; }
+        std::suspend_never final_suspend() noexcept { return {}; }
         void return_void() {}
         void unhandled_exception() {}
     };
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C b/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C
index 7d66ce004f7..e815ca70735 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94879-folly-1.C
@@ -31,7 +31,7 @@  class j {
 
 public:
   std::g initial_suspend();
-  l final_suspend();
+  l final_suspend() noexcept;
 };
 class m : public j {
 public:
diff --git a/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C b/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C
index 088f1335493..c5fa65931e0 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr94883-folly-2.C
@@ -24,7 +24,7 @@  class h {
 public:
   void get_return_object();
   std::b initial_suspend();
-  j final_suspend();
+  j final_suspend() noexcept;
   void unhandled_exception();
   template <typename g> 
     auto await_transform (g c) { return ab(f, c); }
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95050.C b/gcc/testsuite/g++.dg/coroutines/pr95050.C
index fd1516d32f0..2867cfc9b08 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95050.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95050.C
@@ -21,7 +21,7 @@  struct task
   {
     auto get_return_object () -> task  { return {}; }
     auto initial_suspend () -> suspend_always { return {}; }
-    auto final_suspend () -> suspend_always { return {}; }
+    auto final_suspend () noexcept -> suspend_always { return {}; }
     void return_void () {} 
     void unhandled_exception () { }
     void thing (ret_type x) {} 
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95345.C b/gcc/testsuite/g++.dg/coroutines/pr95345.C
index 90e946d91c2..8eae611b8d3 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95345.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95345.C
@@ -14,7 +14,7 @@  struct dummy_coro
   void await_resume() { }
   dummy_coro get_return_object() { return {}; }
   dummy_coro initial_suspend() { return {}; }
-  dummy_coro final_suspend() { return {}; }
+  dummy_coro final_suspend() noexcept { return {}; }
   void return_void() { }
   void unhandled_exception() { }
 };
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95440.C b/gcc/testsuite/g++.dg/coroutines/pr95440.C
index 8542880d1ab..1169da4ea7d 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95440.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95440.C
@@ -22,7 +22,7 @@  struct task
 //    static constexpr suspend_n initial_suspend()  { return {2}; }
 #endif
     static constexpr std::suspend_always initial_suspend()  { return {}; }
-    static constexpr std::suspend_never final_suspend() { return {}; }
+    static constexpr std::suspend_never final_suspend() noexcept { return {}; }
     static constexpr void return_void() {}
     static constexpr void unhandled_exception() {}
   };
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95591.C b/gcc/testsuite/g++.dg/coroutines/pr95591.C
index 664b1d39619..a1a2e57429b 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95591.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95591.C
@@ -12,7 +12,7 @@  struct generator {
         void return_void();
         void unhandled_exception();
         suspend_always initial_suspend();
-        suspend_always final_suspend();
+        suspend_always final_suspend() noexcept;
 
         template<typename Arg>
         suspend_always yield_value(Arg&&) {
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95711.C b/gcc/testsuite/g++.dg/coroutines/pr95711.C
index f6aedb16ebd..682a221509e 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95711.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95711.C
@@ -23,7 +23,7 @@  struct generator{
         std::suspend_always initial_suspend (){
             return {};
         }
-        std::suspend_always final_suspend (){
+        std::suspend_always final_suspend () noexcept {
             return {};
         }
 
diff --git a/gcc/testsuite/g++.dg/coroutines/pr95813.C b/gcc/testsuite/g++.dg/coroutines/pr95813.C
index 445cdf1f7ef..269cba7b06d 100644
--- a/gcc/testsuite/g++.dg/coroutines/pr95813.C
+++ b/gcc/testsuite/g++.dg/coroutines/pr95813.C
@@ -21,7 +21,7 @@  template <typename T, typename... Args>
 struct coroutine_traits<lazy<T>, Args...> {
     struct promise_type {
         suspend_always initial_suspend() const { return {}; }
-        suspend_always final_suspend() const { return {}; }
+        suspend_always final_suspend() const noexcept { return {}; }
         void return_value(T val) {}
         lazy<T> get_return_object() {
             return lazy<T>();
diff --git a/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C b/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C
index b78ae20d9d4..a9594085135 100644
--- a/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C
+++ b/gcc/testsuite/g++.dg/coroutines/symmetric-transfer-00-basic.C
@@ -44,7 +44,7 @@  struct Loopy {
     }
 
     coro::suspend_always initial_suspend() { return {}; }
-    coro::suspend_always final_suspend() { return {}; }
+    coro::suspend_always final_suspend() noexcept { return {}; }
 
     void unhandled_exception() { /*std::terminate();*/  }
     void return_void() {}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C
index 33f8e99d8c3..17dff0dbbec 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-07-tmpl.C
@@ -71,7 +71,7 @@  struct coro1 {
     return suspend_never_prt{};
   }
 
-  auto final_suspend() {
+  auto final_suspend() noexcept {
     PRINT ("get final_suspend");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C
index c5829c455a5..3eefe9e775d 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-17-capture-comp-ref.C
@@ -20,7 +20,7 @@  struct resumable::promise_type {
     return coro_handle::from_promise(*this);
   }
   auto initial_suspend() { return std::suspend_never(); }
-  auto final_suspend() { return std::suspend_always(); }
+  auto final_suspend() noexcept { return std::suspend_always(); }
   void return_value(int x) {used = x;}
   void unhandled_exception() {}
 
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C
index f551c6e7607..dd0a3b749aa 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-00-void-return-is-ready.C
@@ -57,7 +57,7 @@  struct coro1 {
     PRINT ("get initial_suspend (never) ");
     return suspend_never_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always) ");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C
index 03fc6eeb84b..1f4c3debc03 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-01-void-return-is-suspend.C
@@ -57,7 +57,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C
index 36da680f7f9..1a095c627ea 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-03-different-GRO-type.C
@@ -55,7 +55,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C
index 29fb9424f82..abb789aa7ae 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-04-GRO-nontriv.C
@@ -72,7 +72,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C
index 5b1acb81457..91f591a30fc 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-06-template-promise-val-1.C
@@ -63,7 +63,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () const {
+  auto final_suspend () const noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C
index 266bc7b3b26..ac4cca49e98 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-08-template-cast-ret.C
@@ -60,7 +60,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  suspend_always_prt final_suspend () const {
+  suspend_always_prt final_suspend () const noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C
index d14c358c4c5..33683226f63 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-09-bool-await-susp.C
@@ -70,7 +70,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always, but really never) ");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always, but never) ");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C
index 99910f33f53..300052c94ae 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-15-default-return_void.C
@@ -28,7 +28,7 @@  public:
   using coro_handle = std::coroutine_handle<promise_type>;
   auto get_return_object() { return coro_handle::from_promise(*this); }
   auto initial_suspend() { return std::suspend_always(); }
-  auto final_suspend() { return std::suspend_always(); }
+  auto final_suspend() noexcept { return std::suspend_always(); }
   void return_void() { value_ = -1; }
   void unhandled_exception() {}
 private:
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
index 01a75c1905d..9c9d2fa816d 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C
@@ -21,7 +21,7 @@  struct std::coroutine_traits<R, HandleRef, T...> {
         auto initial_suspend() {
           return std::suspend_always{};
          }
-        auto final_suspend() { return std::suspend_never{}; }
+        auto final_suspend() noexcept { return std::suspend_never{}; }
 
         void return_void() {}
         void unhandled_exception() {}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C
index 586b6b25715..15e390ed200 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-00-triv.C
@@ -62,7 +62,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C
index cceee1f19e9..45fc8d71a07 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-03-tmpl.C
@@ -22,7 +22,7 @@  struct looper {
     return suspend_always_prt{};
   }
 
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C
index d9330b33b76..f97bd2377f7 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-yield-04-complex-local-state.C
@@ -25,7 +25,7 @@  struct looper {
     return suspend_always_prt{};
   }
 
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C
index 164c804797d..85135fc50c4 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-0.C
@@ -60,7 +60,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C
index e96b4ed1a8b..6433b62109f 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/exceptions-test-01-n4849-a.C
@@ -87,7 +87,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_susp_throws_prt(throw_control);
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C b/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C
index 789e2c05b69..c90c1525e40 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/func-params-04.C
@@ -12,6 +12,7 @@  struct nontriv {
   int a, b, c;
   nontriv (int _a, int _b, int _c) : a(_a), b(_b), c(_c) {}
   virtual int getA () { return a; }
+  ~nontriv() { a = -1; }
 };
 
 struct coro1
@@ -19,12 +20,12 @@  f (nontriv t) noexcept
 {
   if (t.a > 30)
     {
-      PRINTF ("coro1: about to return %d", t.b);
+      PRINTF ("coro1: about to return %d\n", t.b);
       co_return t.b;
     }
   else if (t.a > 20)
     {
-      PRINTF ("coro1: about to co-return %d", t.c);
+      PRINTF ("coro1: about to co-return %d\n", t.c);
       co_return t.c;
     }
   else
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C b/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C
index ef3ff47c16f..282aa7a7cac 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/local-var-06-structured-binding.C
@@ -15,7 +15,7 @@  struct promise
   promise (Args&... args) {}
  
   coro::suspend_never initial_suspend() { return {}; }
-  coro::suspend_never final_suspend() { return {}; }
+  coro::suspend_never final_suspend() noexcept { return {}; }
 
   future get_return_object() { return {}; }
 
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C b/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C
index 505bfa33662..63561ea2ae7 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/mid-suspend-destruction-0.C
@@ -61,7 +61,7 @@  struct coro1 {
     PRINT ("get initial_suspend (always)");
     return suspend_always_prt{};
   }
-  auto final_suspend () {
+  auto final_suspend () noexcept {
     PRINT ("get final_suspend (always)");
     return suspend_always_prt{};
   }