From 831869a51fe8560b74d77fc40347904581c0234d Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 11 Jan 2021 15:27:10 +0300 Subject: [PATCH] Added checks for C++11 features required by Boost.Multiprecision. As of 2021, Boost.Multiprecision does not support C++03 and fails tests of Boost.Integer. To mitigate, we replicate the preprocessor checks of Boost.Multiprecision to disable its use in Boost.Integer tests in C++03 mode. --- test/multiprecision_config.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/multiprecision_config.hpp b/test/multiprecision_config.hpp index e423111..4e0abe1 100644 --- a/test/multiprecision_config.hpp +++ b/test/multiprecision_config.hpp @@ -8,6 +8,7 @@ #define BOOST_INTEGER_TEST_MULTIPRECISION_CONFIG_HPP_INCLUDED_ #include +#include #if (defined(BOOST_MSVC) && (BOOST_MSVC < 1500)) || \ (defined(__clang_major__) && (__clang_major__ == 3) && (__clang_minor__ < 2)) || \ @@ -15,4 +16,18 @@ #define DISABLE_MP_TESTS #endif +// This list of checks matches those in Boost.Multiprecision, boost/multiprecision/detail/number_base.hpp, +// as it no longer supports C++03 since 2021. +#if !defined(DISABLE_MP_TESTS) && \ + (\ + defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) || defined(BOOST_NO_CXX11_HDR_ARRAY)\ + || defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) || defined(BOOST_NO_CXX11_CONSTEXPR)\ + || (defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) || BOOST_WORKAROUND(__SUNPRO_CC, < 0x5140)) || defined(BOOST_NO_CXX11_REF_QUALIFIERS) || defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)\ + || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_USER_DEFINED_LITERALS) || defined(BOOST_NO_CXX11_THREAD_LOCAL)\ + || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_STATIC_ASSERT) || defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)\ + || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_REF_QUALIFIERS)\ + ) +#define DISABLE_MP_TESTS +#endif + #endif // BOOST_INTEGER_TEST_MULTIPRECISION_CONFIG_HPP_INCLUDED_