[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 Sep 21 09:42:38 PDT 2017


lebedev.ri added a comment.

Tried stage2 build, so far only one warning.
But found out that `ubsan_value.h`'s `typedef s128 SIntMax;` crashes this code because

  class LLVM_NODISCARD APSInt : public APInt {
  ...
    /// \brief Get the correctly-extended \c int64_t value.
    int64_t getExtValue() const {
      assert(getMinSignedBits() <= 64 && "Too many bits for int64_t");
      return isSigned() ? getSExtValue() : getZExtValue();
    }


Repository:
  rL LLVM

https://reviews.llvm.org/D38101





More information about the cfe-commits mailing list