From 4aa89badc8c16637e0d9a39a08da7d18e209631b Mon Sep 17 00:00:00 2001
From: Patrick Palka <ppalka@redhat.com>
Date: Fri, 9 Aug 2024 09:16:45 -0400
Subject: [PATCH] c++: add fixed testcase [PR116289]

Fully fixed since r14-6724-gfced59166f95e9.

	PR c++/116289
	PR c++/113063

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/spaceship-synth16a.C: New test.
---
 gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C

diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C
new file mode 100644
index 000000000000..68388a680b20
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C
@@ -0,0 +1,16 @@
+// PR c++/116289
+// PR c++/113063
+// { dg-do link { target c++20 } }
+// A version of spaceship-synth16.C where the local class isn't empty.
+
+#include <compare>
+
+int main() {
+  struct X {
+    int m = 0;
+    auto operator<=>(const X&) const = default;
+  };
+  X x;
+  static_assert(noexcept(x <=> x));
+  x <=> x;
+}
-- 
GitLab