This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0880b9d52620: [Clang][unittests] Silence trucation warning 
with MSVC 2022 (authored by aganea).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129152

Files:
  clang/unittests/StaticAnalyzer/RangeSetTest.cpp


Index: clang/unittests/StaticAnalyzer/RangeSetTest.cpp
===================================================================
--- clang/unittests/StaticAnalyzer/RangeSetTest.cpp
+++ clang/unittests/StaticAnalyzer/RangeSetTest.cpp
@@ -88,6 +88,12 @@
   template <typename Base>
   static constexpr T X555TruncZeroOf = TruncZeroOf<X555, Base>; // 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<XAAA, sizeof(T) - 1> + 42;
@@ -95,6 +101,10 @@
   // 0x5555'552A
   static constexpr T FromB = ClearLowBytes<X555, sizeof(T) - 1> + 42;
   static constexpr T ToB = FromB + 2; // 0x5555'552C
+
+#if defined(_MSC_VER) && !defined(__clang__)
+#pragma warning(pop)
+#endif
 };
 
 template <typename T>


Index: clang/unittests/StaticAnalyzer/RangeSetTest.cpp
===================================================================
--- clang/unittests/StaticAnalyzer/RangeSetTest.cpp
+++ clang/unittests/StaticAnalyzer/RangeSetTest.cpp
@@ -88,6 +88,12 @@
   template <typename Base>
   static constexpr T X555TruncZeroOf = TruncZeroOf<X555, Base>; // 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<XAAA, sizeof(T) - 1> + 42;
@@ -95,6 +101,10 @@
   // 0x5555'552A
   static constexpr T FromB = ClearLowBytes<X555, sizeof(T) - 1> + 42;
   static constexpr T ToB = FromB + 2; // 0x5555'552C
+
+#if defined(_MSC_VER) && !defined(__clang__)
+#pragma warning(pop)
+#endif
 };
 
 template <typename T>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to