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

Shivam Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 7 20:05:39 PDT 2023


xgupta added a comment.

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.


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