blob: 46065f8e901d4a832805ee8f31da71b81dc56e48 [file] [log] [blame]
// { dg-do compile { target c++20 } }
// LWG 3746. optional's spaceship with U with a type derived from optional
// causes infinite constraint meta-recursion
#include <optional>
struct S : std::optional<char>
{
bool operator==(const S&) const;
bool operator<(const S&) const;
bool operator>(const S&) const;
bool operator<=(const S&) const;
bool operator>=(const S&) const;
};
auto cmp(const S& s, const std::optional<char>& o)
{
return s <=> o;
}