[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3
etienneb accepted this revision. etienneb added a comment. thx for the improvement lgtm https://reviews.llvm.org/D29858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3
etienneb added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:244 + // x != 5 || x != 10 + if (OpcodeLHS == BO_NE || OpcodeLHS == BO_NE) +return true; etienneb wrote: > The good news is that this code will be catch by this check! > ``` > if (OpcodeLHS == BO_NE || OpcodeLHS == BO_NE) <<-- redundant expression > ``` > Should be: > ``` > if (OpcodeLHS == BO_NE || OpcodeRHS == BO_NE) > ``` > > > btw, it should be: ``` if (OpcodeLHS == BO_NE && OpcodeRHS == BO_NE) ``` https://reviews.llvm.org/D29858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D29857: Catch trivially true statements of the form a != 1 || a != 3. Statements likethese are likely errors. They are particularly easy to miss when handling enums:enum State {RUNNING, STOPPE
etienneb added a comment. which one is the final version? https://reviews.llvm.org/D25946 Please close one of them. https://reviews.llvm.org/D29857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3
etienneb added a comment. Could you add some tests with enums (like the one in your description)? This is missing and it's a nice to have. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:244 + // x != 5 || x != 10 + if (OpcodeLHS == BO_NE || OpcodeLHS == BO_NE) +return true; The good news is that this code will be catch by this check! ``` if (OpcodeLHS == BO_NE || OpcodeLHS == BO_NE) <<-- redundant expression ``` Should be: ``` if (OpcodeLHS == BO_NE || OpcodeRHS == BO_NE) ``` https://reviews.llvm.org/D29858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D17981: [clang-tidy] Fix clang-tidy to support parsing of assembly statements.
etienneb added a comment. jckooijman, this issue is still not solved on ToT. You can apply this patch on your local repo. It's fixing the problem, but your executable size will increase. https://reviews.llvm.org/D17981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits