aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2024-08-09 09:16:45 -0400
committerPatrick Palka <ppalka@redhat.com>2024-08-09 09:16:45 -0400
commit4aa89badc8c16637e0d9a39a08da7d18e209631b (patch)
tree8b6e177838507bdd0de9f4e6b262745659c4167d
parent6e7088dbe3bf87108a89558ffb7df36df3469206 (diff)
downloadgcc-4aa89badc8c16637e0d9a39a08da7d18e209631b.zip
gcc-4aa89badc8c16637e0d9a39a08da7d18e209631b.tar.gz
gcc-4aa89badc8c16637e0d9a39a08da7d18e209631b.tar.bz2
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.
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C16
1 files changed, 16 insertions, 0 deletions
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 0000000..68388a6
--- /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;
+}