diff options
Diffstat (limited to 'base/numerics/safe_numerics_unittest.cc')
-rw-r--r-- | base/numerics/safe_numerics_unittest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/numerics/safe_numerics_unittest.cc b/base/numerics/safe_numerics_unittest.cc index 09ad130..23c2c78 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()) \ |