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

    <tr>
        <th>Summary</th>
        <td>
            [libc++][format] Should `operator<<(thead::id)` care about fmtflags in C++23?
        </td>
    </tr>

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

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

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

<pre>
    Repro:

```c++
#include <cassert>
#include <format>
#include <sstream>
#include <thread>

using namespace std;

int main() {
  auto id = this_thread::get_id();
  const auto s1 = format("{}", id);
 ostringstream stream;
  stream << id;
  const auto s2 = stream.str(); // This is "text representation".
  assert(s2 == s1);             // Ok.

  stream.str("");
  stream << hex << id;
  const auto s3 =
      stream.str(); // Should this be the same "text representation"?
  assert(s3 == s1); // Currently, it is not.
}
```

Build:

```console
PS D:\libcxx-playground> clang -std=c++2b -fexperimental-library -Iinclude\c++\v1 -llib\c++ "-llib\windows\clang_rt.builtins-x86_64" .\test.cpp
PS D:\libcxx-playground> .\a.exe
Assertion failed: s3 == s1, file .\test.cpp, line 20
```

The question is: should `operator<<(thread::id)` even care about fmtflags? It seems to me that since P2693R1 (partially implemented in https://github.com/llvm/llvm-project/commit/88622aabf10764cc32d546f448076d25b13e94cd) the text representation is not longer "unspecified" and should always be the same, no matter what the fmtflags/locale/precision are.

CC: @mordante
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVV1vozgU_TXOy1UQ2EDIAw8t2Uiz0mpHM_NeGXMB7xibtU2bzK9fmY82nbazu5FFkK_vxzn3XMOdk51GLEl2T7LTjk--N7b8_Q_-Y7LfJT5J8WNXm-ZafsHRGsLuSHwi8fbM42UJQu_DWnYpk1qoqUEgrBLcObSesN_es7bGDvwjo3PeIh8-sPreIm9ejPNzclJ3oPmAbuQCwfmGsPvbE1J7GLjUhBaEH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