Fix MSVC truncation of constant value warning.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 29 Jun 2020 14:59:53 +0000 (15:59 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 29 Jun 2020 15:03:00 +0000 (16:03 +0100)
llvm/include/llvm/ADT/Bitfields.h

index 7278ec6..2e38cca 100644 (file)
@@ -110,7 +110,7 @@ template <typename T, unsigned Bits> struct BitPatterns {
   static constexpr Unsigned SignBitMask = Unsigned(1) << (Bits - 1); // 00100000
   static constexpr Unsigned Smax = Umax >> 1U;                       // 00011111
   static constexpr Unsigned Smin = ~Smax;                            // 11100000
-  static constexpr Unsigned SignExtend = Smin << 1U;                 // 11000000
+  static constexpr Unsigned SignExtend = Unsigned(Smin << 1U);       // 11000000
 };
 
 /// `Compressor` is used to manipulate the bits of a (possibly signed) integer