[PATCH] D108003: [Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 19 12:06:52 PDT 2021


xbolva00 added a comment.

In D108003#2955058 <https://reviews.llvm.org/D108003#2955058>, @rpbeltran wrote:

> This patch seems like a great contribution! Really glad to see this being added. I did have a question though on why this only appears to catch "&" vs "&&" instead of doing the same for "|" vs "||". It seems like both operators have roughly the same potential for confusion. Could we add support for bitwise vs logical or in this?

Yeah, I mentioned in the first comment as part of “open questions”. Basically at first we need to find out some reasonable “heuristics” when to warn and then support for | should be added.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108003/new/

https://reviews.llvm.org/D108003



More information about the cfe-commits mailing list