-
Notifications
You must be signed in to change notification settings - Fork 13.6k
clang-format regression with spaces around trailing-return-type in macro #142178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-format Author: Barry Revzin (brevzin)
Here is my clang-format file:
```
BasedOnStyle: llvm
AccessModifierOffset: -4
On clang 18.1.4 and later, I started getting this formatting: #define DEFINE_CHECKED(name, op) \
template <typename R, std::integral A, std::integral B> \
constexpr auto checked_##name(A a, B b)->CheckedResult<R> { \
return something_interesting(a, b); \
}
DEFINE_CHECKED(add, +) The spaces around the trailing-return-type are now absent, as if the formatter things this is class member access instead of being a function declaration. I'm not sure exactly when the change happened, those are just two versions I have handy. |
Thanks @owenca! |
Here is my clang-format file:
On clang 17.0.6, I get this formatting:
On clang 18.1.4 and later, I started getting this formatting:
The spaces around the trailing-return-type are now absent, as if the formatter things this is class member access instead of being a function declaration. I'm not sure exactly when the change happened, those are just two versions I have handy.
The text was updated successfully, but these errors were encountered: