llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

add warnings for possible ambiguity in logical expressions not currently covered

Open vabridgers opened this issue 6 years ago • 1 comments

Bugzilla Link 47010
Version trunk
OS Windows NT
CC @zygoloid

Extended Description

During review of https://reviews.llvm.org/D85097, it came out in comments that the current cases are not covered by clang warnings for -Wparentheses, and the specific warning that might cover these. I'd prefer to finish https://reviews.llvm.org/D85097, which covers ambiguous chained compare operations, like x<y<z, and pick this up after as a separate patch.

Filing as a reminder to pick this up later, and use as reference in reply to comments in https://reviews.llvm.org/D85097.

// FIXME - These do not currently trigger any warnings b = (p1 == p2 < p3); // maybe intentional, but definitely deserving of a warning b = (p1 == p2 == p3); // definitely buggy and deserving of a warning b = (p1 != p2 != p3); // definitely buggy and deserving of a warning b = (p1 < p2 == p3 < p4); // maybe intentional, but definitely deserving of a warning b = (p1 == p2 < p3 == p4); // definitely buggy and deserving of a warning

vabridgers avatar Aug 06 '20 00:08 vabridgers

assigned to @vabridgers

vabridgers avatar Aug 06 '20 00:08 vabridgers