<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/104700>104700</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc++] Use hidden friends to avoid circular dependencies in spaceship constrains
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            chrono
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            mordante
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mordante
      </td>
    </tr>
</table>

<pre>
    This as reported in https://github.com/llvm/llvm-project/pull/82113
Per [LWG4139](https://cplusplus.github.io/LWG/issue4139)

```
 Consider

    decltype(std::declval<std::chrono::leap_second&>() <=> std::chrono::system_clock::now())

There is a <=> operator for leap second defined as

    template<class Duration>
      requires three_way_comparable_with<sys_seconds, sys_time<Duration>>
      constexpr auto operator<=>(const leap_second& x, const sys_time<Duration>& y) noexcept;

In order to resolve this overload, we need to check the constraints. three_way_comparable_with will end up checking
that sys_seconds{} < sys_time<Duration>{} is a valid expression. To do that, we run overload resolution, find a bunch
of operator<=>, including the leap_second overload mentioned above. We check its constraints... and we find
ourselves doing that recursively. 
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM1vqzgQ_2ucy2gRmHzAgUOTvDyt9A576KrHyNiT4H2OzXps0vz3KwNN06o9rEQ-MDO_L-wRRPpsERu22jLOL84rYQMyztlqvxAxdM43b6uL1qlb89xpAkHgsXc-oAJtoQuhJ1Y-MX5g_HDWoYttJt2F8YMxw9vPH713_6AMjB_6aAzjh4oXRcnyPcuf_kIPbLX99fJzWZQ1W-0Zrz7Cyt5ESp9sJtCO8cOvl5-MHzRRxLGR1xPe_L3O52u8hZ2zpBX6xxoAAIXShFuPjFcUVKIsn9LaIAwrd_cl2Xln3fTfoOiPhNJZxfialT8YrxivgZU7Vu5Z-QO-bKMbBbwcpXHy97Ri3XVq_aT9uUOPkMJ-wHQ9ehGch5PzkCTAJAE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