[PATCH] D38101: [Sema] Diagnose tautological comparison with type's min/max values

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 12 12:34:54 PDT 2017


lebedev.ri added inline comments.


================
Comment at: lib/Sema/SemaChecking.cpp:8930
+    // We only care about expressions where just one side is literal
+    if (IsRHSIntegralLiteral ^ IsLHSIntegralLiteral) {
+      // Is the constant on the RHS or LHS?
----------------
rsmith wrote:
> It would probably be more obvious to use `||` here, since you already returned in the case where both sides are constant.
And what if neither of them is constant?
I *think* we could reach this point in that case.
At least it is not immediately obvious to me why it can't happen.


Repository:
  rL LLVM

https://reviews.llvm.org/D38101





More information about the cfe-commits mailing list