// PR c++/96242 // { dg-do compile { target c++20 } } #include template struct X { auto operator<=>(const X&) const noexcept(B) = default; bool operator==(const X&) const noexcept(!B) = default; }; X x_t; static_assert(noexcept(x_t <=> x_t)); static_assert(noexcept(x_t < x_t)); static_assert(!noexcept(x_t == x_t)); static_assert(!noexcept(x_t != x_t)); X x_f; static_assert(!noexcept(x_f <=> x_f)); static_assert(!noexcept(x_f < x_f)); static_assert(noexcept(x_f == x_f)); static_assert(noexcept(x_f != x_f));