[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-07 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Looks useful, +1 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85287/new/ https://reviews.llvm.org/D85287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-06 Thread Richard Trieu via Phabricator via cfe-commits
rtrieu added a comment. In D85287#2199490 , @sberg wrote: > In D85287#2199463 , @rtrieu wrote: > >> Also, have you tried running warning over a codebase? > > As I wrote: "At least building LibreOffice with this chan

[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-06 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg added a comment. In D85287#2199463 , @rtrieu wrote: > Are you planning to allow this change to other warnings that use the same > helper functions? No, I didn't plan to work on this further. Just scratching that itch of why Clang didn't emit that

[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-06 Thread Richard Trieu via Phabricator via cfe-commits
rtrieu added a subscriber: AndersRonnholm. rtrieu added a comment. I looked back on the commits and while I did commit, I did it on the behalf of Anders Rönnholm, who did not have commit access at the time. I haven't seen activity from Anders in a while, but added to subscribers just in case.

[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-05 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg added a comment. My naive assumption was that this warning had initially been restricted to integer literals and enumerators to avoid false positives. Hence my conservative approach of extending merely to constant integer expressions for now. Maybe Richard as the original author of the

[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-05 Thread Jordan Rose via Phabricator via cfe-commits
jordan_rose added a comment. Nothing seems too mysterious here, but why limit to `constexpr` instead of anything where Clang can see a constant value, which would make it work in C as well? (If you're allowing `constexpr`, you're already allowing arbitrary work.) CHANGES SINCE LAST ACTION ht

[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-05 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg updated this revision to Diff 283204. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85287/new/ https://reviews.llvm.org/D85287 Files: clang/lib/Analysis/CFG.cpp clang/test/Sema/warn-bitwise-compare.c clang/test/SemaCXX/warn-bitwise-compare.cpp Index: clang/test/SemaCXX/warn-

[PATCH] D85287: Extend -Wtautological-bitwise-compare "bitwise or with non-zero value" warnings

2020-08-05 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg created this revision. sberg added reviewers: jordan_rose, rtrieu. Herald added a project: clang. sberg requested review of this revision. ...to C++ constant expression operands. (I had been puzzled why Clang had not found