[PATCH] D85097: [Sema] add warning for comparisons like 'x<=y<=z'

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 22 16:22:38 PDT 2020


xbolva00 added inline comments.


================
Comment at: clang/test/Sema/warn-compare-op-parentheses.c:49
+  b = p1 > p2 < p3;
+  // expected-warning at -1 {{comparisons like 'x<=y<=z' are interpreted as '(x<=y ? 1 : 0) <= z'}}
+  // expected-note at -2 {{place parentheses around the '>' comparison to silence this warning}}
----------------
Not very user friendly warning text..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85097



More information about the cfe-commits mailing list