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

    <tr>
        <th>Summary</th>
        <td>
            clang-format keeps allocating memory until it crashes
        </td>
    </tr>

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

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

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

<pre>
    Run clang-format on this file with no particular options: https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp
It will quickly allocate gigabytes of memory until it crashes.
Building with clang works fine.
Tested with LLVM 13 and 15 (main branch).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9UEtr3DAQ_jXyZYix7KhrH3RICIVCegmh1yJLY1vZseTqkWX_fWVvQymlBcF8w4y-x4zeXOVLdqBJuflu8mFVCbyDtNgIkyWEi00LOA-bCsnqTCqA35L1LrLuAZaUth2w9nN5c9nNY639WhpHflmVcwW-Rb-XkfxYisF3JL8VFK2bCb9bpykb_PtPvWwba55Y8_AlFSNE8CNbfaYrKCKvVUKY7azGa8IIfoIVVx-ukF2yBDaBDiouGOsbx2O2ZIriLdKRGC4-nPegDn8tvWJMaG4rz8_fvgLvQDkDXABr-1VZB2NQTi-sHerKyM4M3aCqZBOh_OOKZ8QtfhjdZf_hrsqB5H_uSPT-Ue624N9Qp9LaGDPGAoQQ3X21yEaPXDQ9R6HRmK5XwgjTcz58mjp-0lNFakSKkolH1rYOL3BQFMzEU2Vl27RtI_iJdwX0teBt05iJD0r0w0kYdt9gSU_17qP2Ya6CPCyNeY5lSDam-HuoYrSzQzzkCr_KafFB6nO5JRKG6hCXh_mf7GDYcA">