-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang-format] mistaking reference for binary operator in macro with clang-format 19 #100304
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
Bisected to ce1a874. |
While continuing to try out the new version, I've come across several more instances which could be the same issue. clang-format 18.1.7 #define MACRO(MYTYPE) \
template <> bool foo<MYTYPE>::bar(MYTYPE *Value, bool B) const {}
#define MACRO() template <typename... ARGS> Test(ARGS &&...);
#define MACRO() Foo(Foo &&That) noexcept;
#define MACRO(NAMESPACE) Foo fun_##NAMESPACE##_tion(Bar *Value); clang-format 19.1.0 #define MACRO(MYTYPE) \
template <> bool foo<MYTYPE>::bar(MYTYPE * Value, bool B) const {}
#define MACRO() template <typename... ARGS> Test(ARGS && ...);
#define MACRO() Foo(Foo && That) noexcept;
#define MACRO(NAMESPACE) Foo fun_##NAMESPACE##_tion(Bar * Value); |
/cherry-pick 7e7a906 |
llvmbot
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Jul 25, 2024
/pull-request #100499 |
yuxuanchen1997
pushed a commit
that referenced
this issue
Jul 25, 2024
)" Summary: This reverts commit ce1a874. Closes #100304. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250538
tru
pushed a commit
to llvmbot/llvm-project
that referenced
this issue
Jul 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While trying out clang-format on the new 19.x branch, I discovered an issue with the formatting in macros.
It is incorrectly treating the rvalue reference as a binary operator.
In clang-format 18.1.7 with the default LLVM style:
In clang-format 19.1.0 (183e8ec)
I also discovered that a similar thing happens with
*
and&
as well. I.e.The text was updated successfully, but these errors were encountered: