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

    <tr>
        <th>Summary</th>
        <td>
            [libc++][format] Formatting range with `m` range-type is incorrect
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

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

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

<pre>
    [[format.range.formatter], Table 80](http://eel.is/c++draft/format.range.formatter#tab:formatter.range.type):

> (m option) Indicates that the opening bracket should be "{", the closing bracket should be "}", the separator should be ", ", and each range element should be formatted as if m were specified for its tuple-type.

Current implementation does not format range elements as if `m` tuple-type was specified, see for example https://godbolt.org/z/nzenfobqW:

```c++
#include <format>
#include <print>
#include <vector>
#include <utility>

int main() {
    std::vector<std::pair<int, int>> v = {{1, 2}, {3, 4}, {5, 6}};
    std::println("{:m}", v);
}
```

Expected:

```console
{1: 2, 3: 4, 5: 6}
```

Got:

```console
{(1, 2), (3, 4), (5, 6)}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE-PrDYM_zThYu0IHIaBA4eZYadqpd4q9RyCZ0hfSGgSdt_up68CzJ9u3zxVQknsmN_PdmwL79XFENVse2DbJhFT6K2rf_tdfE7um6J3JT-T1nYfi8HhbN0gwsYJc6HNIgRybNswPMIfotUEZTqLZR_CyPie4YnhiUhvlGd4kgwPDA-dE-fA8PQED3kQLeP7m2a1CB8jMawibNqw9LryV2BYDmDHoKxhWMGvplNSBPIQehEg9AR2JKPMBVon5DcK4Hs76Q5aAobIdoe44nE2ldr6n5g2D6aeRuFEsO6LER6vmzAdkJA9zCEAaRrIPGJeg-xAeFBnGOCdHIEfSaqzoi4agAoewjRqeok52DyGf5yci4hqGBdsEbMAnSUPxoYV_9_0fuViRTqwIn2Ahnfh79wxAE-zj0DfRWSA-LD-9rIX27VWh411F4anT4Yn80nmbNu___z6TEW6fGsNrFrkykg9dQSMHxdfGX_90eXolHl290YyWPfkcgpKq_Bxv51XZQIMQhmGZSyZWAKzHgDAhy56z_dX3ONNMwoV5egKHmH1iL_CGzDezCi7Qxavlko5RhWPe36Xt3EvorxrGP8R7xyrXnybq5Pvh3vlvc1NcM3grvmS4McoX7-PJAN1Tx_DGm81XaEOGeN7mEl4POXxtI2n4uc8v9jwfykYlmuCsFoapVwTdJPXBGH1X9Kkq3lX8UokVGe7LM94xssq6evzmbjMc5HnXXEucyk4cSGqUmS7ssxIJqrGFPM0xyLLeIHVJifkRSq5xFRUIs1YntIglN5o_TbEik6U9xPVVZpVRaJFS9rPgxBRq_Zaxohxcro6_vTSThfP8lQrH_wdJqig5xn78Nu2uc1Ttm3gtEyBOHaWTn1Xob_156xa-lN5UEZa50iGZHK6_tKPKvRTu5F2YHiKDqzby-jsXyTj0J2DisN4juufAAAA___cAMBF">