From 325c7236e75d9d07e8cc88278b9930b22cf5107f Mon Sep 17 00:00:00 2001 From: IRainman Date: Thu, 25 Dec 2025 19:16:26 +0300 Subject: [PATCH] MSVC compilation fix. --- tests/basictest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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