You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
$ cat test.cpp
#defineP(ptr) auto p = (ptr)->p
In version 16, this is correctly formatted:
$ clang-format-16 test.cpp
#defineP(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:
$ clang-format-17 test.cpp
#defineP(ptr) auto p = (ptr) -> p
$ clang-format-17 --version
clang-format version 17.0.0
Interestingly, the behavior is switched when the macro is removed:
$ cat test.cpp
auto p = (ptr)->p;
$ clang-format-17 test.cpp
auto p = (ptr)->p;
$ clang-format-16 test.cpp
auto p = (ptr) -> p;