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

    <tr>
        <th>Summary</th>
        <td>
            [libc++][format] Negation of `INT_MIN` (UB) when formatting `chrono::duration`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Example:

```c++
#include <chrono>
#include <format>
#include <iostream>

using namespace std; 

int main() {
    cout << format("{:%Q}\n", chrono::nanoseconds::min());
}
```

Expected output:
```console
-9223372036854775808
```

Got:
```console
--9223372036854775808
```

Compiler explorer: https://godbolt.org/z/cvcYsTbM8
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU99r2zAQ_mvOL6JBPlmy8-CHJK5HBy0Muoc9DVlSEm2yZCy57frXDzvJGsp-MDhkuDt_992nTzJGe_DG1MC3wJtMTukYxvrjvXydxu_WPFv1mnVB_6hvX2Q_OANsA7QBejkFPYUC3M5xyiKzXrlJGwJsp45j8AHY7e-K-zD2Mv2haENMo5H9W3k5p2j9gXjZmzhIZUhMGtiWXLdYn0gvrQesANcEyjMzQghRYUozOrAdOY-fu3BuYhtA_gnKBvjOzznckQv_DbCNlz5Eo4LX8ZToLzPmYJf9y-adPNfcbl8Go5LRJExpmNKbor-0DD4GZ07ZmzUiYyVSJipelCWvaPUX8A_hn4D_ibgL_WCdGYl5GVwYzQhsQ44pDYsC2AK2h6C74NIqjAfA9hWwVU_qS3zs7qtM10yv2Vpmps5FWdCCCUazYy04ljrXUnBaVsgE17xYF0W3X--V0LzIbI0UGc3zKkda5nSlqJK5ElwrUbK8UlBQ00vrVs499fPszMY4mVrQHFnmZGdcXHyN6M0zWYrzlfImG-v5n5tuOkQoqLMxxTeUZJNbHoSz3cXWvAG-PZuFN-TBHGSywZOwJyDo3cPj1_u7BxCUAFaft7Plno_Gn-2VZrvO13BlJD2NCwIImk2jq98JatNx6lYq9IDtTOz8uRnG8M2oBNgu60TAdln3ZwAAAP__hKEQng">