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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Formatting regression in 17.0.0 introduces spacing around arrow operator in macros
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          sfc-gh-mheimel
      </td>
    </tr>
</table>

<pre>
    It seems that there is a formatting regression in 17.0.0 that affects the spacing of the arrow operator in macros containing assignments. Here's a minimal example (with an empty clang format config) to reproduce the issue:
```c++
$ cat test.cpp
#define P(ptr) auto p = (ptr)->p
```

In version 16, this is correctly formatted:
```c++
$ clang-format-16 test.cpp
#define P(ptr) auto p = (ptr)->p
$ clang-format-16 --version
clang-format version 16.0.0
```

With version 17, clang-format (incorrectly) wants to add spacing around the arrow operator:
```c++
$ clang-format-17 test.cpp
#define P(ptr) auto p = (ptr) -> p
$ clang-format-17 --version
clang-format version 17.0.0
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE1vnDAQ_TXmMgKB-VoOHJJuV82tt569ZgyusI3sIWn-fWXYbJMoadOqkgWymXm892Y8IgQ9WsSe1besPiZipcn5PiiZjlNqJtQG5-Tshsf-jiAgmgA0CQKa0CPoAAKU80YQaTuCx9FjCNpZ0BaKNsuzfI8XSqGkmIwQFiFjtFPbVnjvHsAt6AU5HxONkN4FkM6S0DaG7jwNWgoZfEGPjLfx30ZbbcQM-EOYZUZg_PCgaQJhAc1CjyBnYccLxQio9Mh4B-TA4-LdsErcSOgQVmTlDcuPLL9hTb4vyfhtXPspr0BG7Rgok8vydFoOqLRF-Mr4YSEf8cVKDhZg5RGuhykrPy-v8C_b7Xln4R79Zl7RMP4JaNIhWiyd9yhpfnyyGoePMI3K0z0jLZr_wfoN1DS9cN5Dnn9-pib2wW-Uf4slu0a3UfsLIMYP2l5diEwfhI3N5EAMw7WfhHerHd7oqb92q_1XtyDaBe_61X7Mr_YNv5KhL4eu7ESCfdF0NedV17bJ1Iuay1zlQ1FIVRRKdRU_dJ3KK9EWvO3KRPc852Xe8byoq65sM1ULrJuhxu6MgywVq3I0Qs_ZPN-bzPkx2W5D3zQdL5NZnHEO24Dg_DlfxnkcGb6Pael5HQOr8lkHCr-ASNO8DZcXifURTn8YGtrSfjvD6_K-Ny6S1c_9RLSEWG5-Yvw0aprWcyadYfwUOV1e6eLdd5TE-GlTGhg_bWJ_BgAA___ye5Rb">