blob: 400d9931b6688eee0a8adf6eb62c28d613f3275b [file] [log] [blame]
// Test explicit weak_ordering.
// { dg-do compile { target c++20 } }
#include <compare>
struct A
{
int i;
std::weak_ordering operator<=> (const A&) const = default;
};
constexpr A a = { 42 };
constexpr auto c = a <=> a;
static_assert (std::same_as <decltype (c), const std::weak_ordering>);
static_assert (std::is_eq (c));