https://gcc.gnu.org/g:4aa89badc8c16637e0d9a39a08da7d18e209631b

commit r15-2848-g4aa89badc8c16637e0d9a39a08da7d18e209631b
Author: Patrick Palka <ppa...@redhat.com>
Date:   Fri Aug 9 09:16:45 2024 -0400

    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.

Diff:
---
 gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

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;
+}

Reply via email to