From: Patrick Palka Date: Fri, 9 Aug 2024 13:16:45 +0000 (-0400) Subject: c++: add fixed testcase [PR116289] X-Git-Tag: basepoints/gcc-16~6705 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4aa89badc8c16637e0d9a39a08da7d18e209631b;p=thirdparty%2Fgcc.git 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 --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-synth16a.C new file mode 100644 index 00000000000..68388a680b2 --- /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 + +int main() { + struct X { + int m = 0; + auto operator<=>(const X&) const = default; + }; + X x; + static_assert(noexcept(x <=> x)); + x <=> x; +}