[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Fri May 17 19:33:27 PDT 2024


================
@@ -36,7 +36,7 @@ namespace InExpr {
 
     // These are valid expressions.
     foo<foo; // expected-warning {{self-comparison}}
-    foo<int()>(0);
+    foo<int()>(0); // expected-warning {{comparisons like 'X<=Y<=Z' don't have their mathematical meaning}}
     foo<int(), true>(false);
----------------
shafik wrote:

It is a shame we don't catch this one but neither does gcc

https://github.com/llvm/llvm-project/pull/92200


More information about the cfe-commits mailing list