c++: P0847R7 (deducing this) - xobj lambdas. [PR102609]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / spaceship-synth15.C
blob00ea6c10474481ae74a02daf184f270bd40b8fcf
1 // PR c++/96242
2 // { dg-do compile { target c++20 } }
4 #include <compare>
6 template<bool B>
7 struct X {
8   auto operator<=>(const X&) const noexcept(B) = default;
9   bool operator==(const X&) const noexcept(!B) = default;
12 X<true> x_t;
13 static_assert(noexcept(x_t <=> x_t));
14 static_assert(noexcept(x_t < x_t));
15 static_assert(!noexcept(x_t == x_t));
16 static_assert(!noexcept(x_t != x_t));
18 X<false> x_f;
19 static_assert(!noexcept(x_f <=> x_f));
20 static_assert(!noexcept(x_f < x_f));
21 static_assert(noexcept(x_f == x_f));
22 static_assert(noexcept(x_f != x_f));