Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp | ||
---|---|---|
605 | This seems incorrect to me -- the LHS and RHS can be swapped along with which operator is used and still achieve the same semantic results. While playing around to test the behavior we currently have, I was a bit surprised at the difference in results here: https://godbolt.org/z/hE4qfca1b. Also, do we need to bind? Nothing seems to look at that binding that I can see. |
Thanks for the quick review @aaron.ballman! I think I've addressed your comments.
clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp | ||
---|---|---|
605 |
Fixed.
All four conditions get a warning with my changes. I've added your example to the test file.
Yes, it is hard to see, but here the constant is actually read. |
LGTM! Please also add a release note for the fix when you land it.
clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp | ||
---|---|---|
605 |
Oh, thanks for the info! |
This seems incorrect to me -- the LHS and RHS can be swapped along with which operator is used and still achieve the same semantic results.
While playing around to test the behavior we currently have, I was a bit surprised at the difference in results here: https://godbolt.org/z/hE4qfca1b.
Also, do we need to bind? Nothing seems to look at that binding that I can see.