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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] auto variable initialized with arrow operator can be seen as trailing return type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

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

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

<pre>
    Input code:
```c++
auto a = (b)->c;
```
Result from clang-format-17 (`main`), with default style (`{}`):
```c++
auto a = (b) -> c;
```

The arrow is annotated as a trailing return type arrow due to an imperfect heuristic in `determineTokenType`.

This issue isn't encountered without the (redundant) parentheses:
```c++
auto a = b->c;
```

Originally discovered in https://reviews.llvm.org/D141811; I planned to make a fix for it there, but it turned out harder than I expected, so I'm adding an issue for it so I don't forget.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU82uqzYQfhqzGSUyJoGwYHHTNNJZVarOCwx4AtNrbGQPOTd9-sok_TlVW_VKlpHhG_z9zGBKPHqiTh3P6ngpcJUpxC4-ZiZX9ME-uje_rAJDsKSqL0pflP6iav1cgzLnvLa3uEoABFVdQJlTr0y7U9WPg6rOf6t6Hn-mtDqBWwwzDA79uLuFOKPsyibXq1rPyD7DTavMD_DBMoGlG-aqJA9HL5hqzqq5vIDfSxEyR_hXks_9fSLAGMMHcAL0PggKWcAECBKRHfsRIskaPchj-R1sV4J8nweeF4o3GgQmWiMn4QHYg6q1JaE4s6f38JX8-2MhVev958s5Aae0EnDyyjQC5IeweqFIdrMlrAIybX5Esqu36CVrWzCSl4kSpf9vTP-fqT33nyKP7NG5B1hOQ7hvVNjDJLJsd5mrMtdId6aPtHfuPu9DHJW5XspDeSpLVZ3hDRaH3pPNJs34lQDhxt_gFiLwJihSDr5fZTuvMWOz1gmjpQgyoYc3oG8LDUI2Y1OAN2WaGdDaHEr2frPu9dP8HWx42ngLcSTZF7arbFu1WFBX1k2rD3V5LIup66uhNm190LZBW_Xtsa21bqmudY3Y6rLgzmhT6apsdHswVblvTlqfsCoPA1F9MlodNM3I7g8Hio1NV5eHui0c9uTSNnrG_HUElDF5GGOXy3b9OiZ10I6T_GllISxuG9tPhccLbFHeMTL2joA9C6PjX1-t8mrNsFBECREG9NATJCKf-_mfurlYo-s-BzuyTGu_H8KszDVTej12Swy_0CDKXDehSZnrpvW3AAAA__9Cb1q5">