[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Fri May 17 06:33:32 PDT 2024
================
@@ -85,7 +85,7 @@ void f(int x, int y, int z) {
if ((a<y) != -1) {}// expected-warning {{comparison of constant -1 with boolean expression is always true}}
if ((a<y) == z) {} // no warning
- if (a>y<z) {} // no warning
+ if (a>y<z) {} // expected-warning {{comparisons like 'X<=Y<=Z' don't have their mathematical meaning}}
----------------
Endilll wrote:
Just throwing a wording idea: `chaining of comparison operators`.
https://github.com/llvm/llvm-project/pull/92200
More information about the cfe-commits
mailing list