[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr
Zinovy Nis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 4 11:00:23 PDT 2020
zinovy.nis marked an inline comment as done.
zinovy.nis added inline comments.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-redundant-expression.cpp:196
bool operator>(const MyStruct& lhs, MyStruct& rhs) { rhs.x--; return lhs.x > rhs.x; }
bool operator||(MyStruct& lhs, const MyStruct& rhs) { lhs.x++; return lhs.x || rhs.x; }
----------------
njames93 wrote:
> This is why you aren't getting warnings issued when the test case is at the bottom. You have defined a `||` operator at global namespace level which I'm guessing leads to ambiguity when checking the `static_assert` operator in your test case - It'll have a dependent type.
> Simple fix is to change the static_assert to use say `operator==` as that isn't defined globally.
It helped, thanks!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80896/new/
https://reviews.llvm.org/D80896
More information about the cfe-commits
mailing list