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

    <tr>
        <th>Summary</th>
        <td>
            Using `std::format` with `float` or `double` based `std::chrono::time_point` causes `error: invalid operands to binary expression`
        </td>
    </tr>

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

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

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

<pre>
    Consider the following code snippet:

~~~ cpp
using Representation = double;
using Duration       = std::chrono::duration<Representation>;
using Clock          = std::chrono::system_clock;
using TimePoint      = std::chrono::time_point<Clock, Duration>;

TimePoint tp = {};

std::string time_string = std::format("{:%d.%m.%Y %H:%M:%S}", tp);
~~~

This results in the compile error:

~~~
error: invalid operands to binary expression ('basic_ostringstream<char>' and 'const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<double>>')
                  __os << __t;
 ~~~~ ^  ~~~
~~~

If you change the type def `Representation` to an integer or unsigned integer type, the code compiles.

System Info:

~~~
OS: Ubuntu 22.04 LTS
Clang-Version: 15.0.7
~~~

Here is a link with the code that produces the error at [Compiler Explorer](https://godbolt.org/z/4nqP6jn4c). The error is still present in the newest available Clang version (17.0.1) at Compiler explorer.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVMFu4zYQ_ZrxZbACTVlSdNAhkWNkgRZdNNkCPRmUOLa4S5EqSSXrHvztBSXHSbwN0upAUdRw5s17jxTeq70hqiC7gWy9EGPorKvulAud6Hty11o_kHNi0Vh5qGprvJLkMHSEO6u1fVJmj62VhN6oYaAA6TWwNbDTeDwesR2G-WP0Mfp3Ghx5MkEEZQ1CukZpx0YTpDev49ajmyPmJ8b5IGP-9LrtnDV2nstTHKT129SQ3l6krLVtv-P5eTelP_hA_baN4RcpHlRPX6wy4YMUQfW0HWIgpPVUF3h97uk1tHl8yRuG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