diff --git a/tests/basictest.cpp b/tests/basictest.cpp index 514f526..2175746 100644 --- a/tests/basictest.cpp +++ b/tests/basictest.cpp @@ -21,6 +21,16 @@ #endif // #ifndef FASTFLOAT_CONSTEXPR_TESTS #endif // FASTFLOAT_IS_CONSTEXPR +// MSVC's constexpr evaluation and some constexpr-friendly std library pieces +// (like i/o and certain std::numeric_limits members) aren't suitable for the +// compile-time tests in this file on MSVC; disable the constexpr tests when +// compiling with MSVC (but allow them for clang/clang-cl). +#if defined(_MSC_VER) && !defined(__clang__) +# ifdef FASTFLOAT_CONSTEXPR_TESTS +# undef FASTFLOAT_CONSTEXPR_TESTS +# endif +#endif + #if FASTFLOAT_HAS_BIT_CAST #include #endif