[PATCH] D142609: [Clang] Fix -Wconstant-logical-operand when LHS is a constant

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 04:43:34 PDT 2023


aaron.ballman added a comment.

In D142609#4568095 <https://reviews.llvm.org/D142609#4568095>, @xgupta wrote:

> In D142609#4566418 <https://reviews.llvm.org/D142609#4566418>, @aaron.ballman wrote:
>
>> Concerns have been raised in https://github.com/llvm/llvm-project/issues/64356 that this is an undesirable change in diagnostic behavior. The diagnostic is supposed to fire when misusing a logical operand that most likely should have been a bitwise operand. There's a feeling that `true && expr` is plausibly done intentionally more often than `true & expr`.
>>
>> I think we should revert the changes from this patch and in the Clang 17.x branch so that we can reevaluate the approach taken in this patch. CC @porglezomp @cjdb
>
> This got reverted and cherry-pick request is made - https://github.com/llvm/llvm-project/issues/64515.

Thank you! There's been some more discussion about the design on the github issue, in case you're interested in continuing to pursue this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142609



More information about the cfe-commits mailing list