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

    <tr>
        <th>Summary</th>
        <td>
            Lambda trailing return spacing different when called withing std algorithm
        </td>
    </tr>

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

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

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

<pre>
    $ clang-format --version
clang-format version 14.0.0 (Red Hat 14.0.0-1.module_el8.7.0+1142+5343df54)

When formatting the attached code a space inserted after the trailing return of the second lambda but not the first.  Is there an option to make this consistent or is it a bug? (FWIW I _want_ the space)

Before :

```
  transform(  begin( v), end( v), back_inserter( vPlusOne ), [](auto thing )->auto{return thing+1;} );

  auto addTwo=[](auto thing)->auto{ return thing + 2;};
```

After calling `clang-format --style=GNU` :

```
  transform (
      begin (v), end (v), back_inserter (vPlusOne),
      [](auto thing) -> auto{ return thing + 1; });

  auto addTwo = [](auto thing) -> auto { return thing + 2; };
```

[main.cpp.txt](https://github.com/llvm/llvm-project/files/8753688/main.cpp.txt)




</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVFFv2yAQ_jX45RTLwXYSP_ihWZat0rRN06Y-Rthgm5VABLjZ_v0OnKpO1a6bZRnuPvMd9x1HY_jvmtACWsV0v-iMPTIPi8WDsE4aTbIdyW6usAsCyyLN0gwI3XwTHD4iMnkWy_Ro-KjEQahNuk4zQrfLZUFxKPMi511ZEFpNxNP3bhAaJnYvdQ9-EIBT1g5I3BqOFrgTawVI7YT16GWdFzb-6C2TKqyywo9Wg-mi24nWaA6KHRvOoBk9aOMj0knrfApw64JpkRwXnXxIyRs4snvkHKTDwNpJ54X2YCygQ3oITD3J9yHr_d3tHdzC4cy0P0wxwx6f5bYVmJgAkt_MvWSVXd5oQshCuyABEgM0opc6zB4CG30HQvO52bD2_nDRwkbgqxrdF41xph9IuSXlDhE2Yk6YDuqD0ILk74OHrLcXtSIUCkTyLVnv4nqczbYKEDkY59_PhuS7F6ivmWFOjYRboBP5E_F19tP3Jla0ZSoWE8FnB9L530pg_A-ffyD474KGUj06wxO1Dc6ZtnPzStsIXLSd8DnVy1JA0AJeFSMoDUGNvyuNCe7eDACvyg1v6o3cRyZ12p5Oqf_lpziD9ycXpKV7fHvph7FJW4Oncq_Uw-OwOFnzU7QezU4q4XDcrMt8tdng7Ir0uhfm34TXOa_yiiVeeiXqT1OjPu_m0FLB5LLrsFexF8_hsgjHBG-Bs5yydh5vBNUbi_YxGa2q_zsR6dwYMynLVUmToe6yNuM867KKVXTNRVWsacXKqmyoyFqRJYo1Qrl6qlEia5pRmpU0X2bLDc3Tpmmbqilp0Yh8xQpGikygNioNgVNj-8TWcQ94ozgEFd417glkzsleC_HIj-UejK2bRmgtvHdJ3HAdd_sH9Ia51Q">