blob: 1ff39549973cf4d581f470000d97f1beb9d3c196 [file] [log] [blame]
// Test explicit weak_ordering.
// { dg-do compile { target c++2a } }
#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));