// { 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 struct S : std::optional { 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& o) { return s <=> o; }