Open shrek1402 opened 2 years ago
I use this command: clang-tidy.exe -fix test.cpp -- -std=c++17
@llvm/issue-subscribers-bug
@llvm/issue-subscribers-clang-tidy
Whats interesting is the missing parenthesis in the copy-assignment parameter.
In general: Macros are working on just tokens. That means it is not possible to detect if the thing you are inserting to is a type-name or a variable name. This is the reason why C++ tries to get rid of macros and replace them with e.g. meta-classes.
I am not sure if this is even possible to fix in clang-tidy. But it needs to be understood why the parens are not present in the copy assignment parameter.
I am afraid that you must silence this warning manually with NOLINT
or NOLINTNEXTLINE
(see clang-tidy docs for reference)
Before:
After:
(pair_name) & operator=
there is an error due to parentheses.