diff --git a/clang/unittests/StaticAnalyzer/RangeSetTest.cpp b/clang/unittests/StaticAnalyzer/RangeSetTest.cpp --- a/clang/unittests/StaticAnalyzer/RangeSetTest.cpp +++ b/clang/unittests/StaticAnalyzer/RangeSetTest.cpp @@ -88,6 +88,12 @@ template static constexpr T X555TruncZeroOf = TruncZeroOf; // 0x5555'5600 +// Silence 'warning C4309: 'initializing': truncation of constant value' +// in RangeSetCastToPromotionConversionTest. +#if defined(_MSC_VER) && !defined(__clang__) +#pragma warning(push) +#pragma warning(disable : 4309) +#endif // Numbers for ranges with the same bits in the lowest byte. // 0xAAAA'AA2A static constexpr T FromA = ClearLowBytes + 42; @@ -95,6 +101,10 @@ // 0x5555'552A static constexpr T FromB = ClearLowBytes + 42; static constexpr T ToB = FromB + 2; // 0x5555'552C + +#if defined(_MSC_VER) && !defined(__clang__) +#pragma warning(pop) +#endif }; template