Index: base/numerics/safe_numerics_unittest.cc |
diff --git a/base/numerics/safe_numerics_unittest.cc b/base/numerics/safe_numerics_unittest.cc |
index 09ad1305a148f4f0fef21ea3a95b63caa1234b62..23c2c78a7866c4022cae593a5e0dcda0d497698e 100644 |
--- a/base/numerics/safe_numerics_unittest.cc |
+++ b/base/numerics/safe_numerics_unittest.cc |
@@ -34,6 +34,13 @@ inline void ResetFloatingPointUnit() { |
#endif |
} |
+// These tests deliberately cause arithmetic overflows. If the compiler is |
+// aggressive enough, it can const fold these overflows. Disable warnings about |
+// overflows for const expressions. |
+#if defined(OS_WIN) |
+#pragma warning(disable:4756) |
+#endif |
+ |
// Helper macros to wrap displaying the conversion types and line numbers. |
#define TEST_EXPECTED_VALIDITY(expected, actual) \ |
EXPECT_EQ(expected, CheckedNumeric<Dst>(actual).validity()) \ |