From 38d54034d754eab8547d07b1c40e3913e4ece64e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 25 Sep 2024 18:19:55 +0300 Subject: [PATCH] Update sp_constexpr_test, sp_constexpr_test2 --- test/sp_constexpr_test.cpp | 28 ++++++++++++++-------------- test/sp_constexpr_test2.cpp | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/test/sp_constexpr_test.cpp b/test/sp_constexpr_test.cpp index da6c82e698..d228636ab8 100644 --- a/test/sp_constexpr_test.cpp +++ b/test/sp_constexpr_test.cpp @@ -10,26 +10,26 @@ #include #include +#include +#include -#define HAVE_CONSTEXPR_INIT +#if BOOST_WORKAROUND( BOOST_MSVC, < 1930 ) -#if defined( BOOST_NO_CXX11_CONSTEXPR ) -# undef HAVE_CONSTEXPR_INIT -#endif +// MSVC does not implement static initialization for constexpr constructors +BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_MSVC < 1930") +int main() {} -#if BOOST_WORKAROUND( BOOST_MSVC, < 1930 ) -# undef HAVE_CONSTEXPR_INIT -#endif +#elif defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) -#if defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) -# undef HAVE_CONSTEXPR_INIT -#endif +// Clang only implements static initialization for constexpr in C++14 mode +BOOST_PRAGMA_MESSAGE("Skipping test due to __clang__ and BOOST_NO_CXX14_CONSTEXPR") +int main() {} -#if !defined( HAVE_CONSTEXPR_INIT ) +#elif defined( _LIBCPP_VERSION ) && ( _LIBCPP_VERSION < 6000 ) -int main() -{ -} +// in libc++, atomic_flag has a non-constexpr constructor from bool +BOOST_PRAGMA_MESSAGE("Skipping test due to _LIBCPP_VERSION " BOOST_STRINGIZE(_LIBCPP_VERSION)) +int main() {} #else diff --git a/test/sp_constexpr_test2.cpp b/test/sp_constexpr_test2.cpp index 06ea6a108d..ed52d91e54 100644 --- a/test/sp_constexpr_test2.cpp +++ b/test/sp_constexpr_test2.cpp @@ -10,26 +10,26 @@ #include #include +#include +#include -#define HAVE_CONSTEXPR_INIT +#if BOOST_WORKAROUND( BOOST_MSVC, < 1930 ) -#if defined( BOOST_NO_CXX11_CONSTEXPR ) -# undef HAVE_CONSTEXPR_INIT -#endif +// MSVC does not implement static initialization for constexpr constructors +BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_MSVC < 1930") +int main() {} -#if BOOST_WORKAROUND( BOOST_MSVC, < 1930 ) -# undef HAVE_CONSTEXPR_INIT -#endif +#elif defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) -#if defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) -# undef HAVE_CONSTEXPR_INIT -#endif +// Clang only implements static initialization for constexpr in C++14 mode +BOOST_PRAGMA_MESSAGE("Skipping test due to __clang__ and BOOST_NO_CXX14_CONSTEXPR") +int main() {} -#if !defined( HAVE_CONSTEXPR_INIT ) +#elif defined( _LIBCPP_VERSION ) && ( _LIBCPP_VERSION < 6000 ) -int main() -{ -} +// in libc++, atomic_flag has a non-constexpr constructor from bool +BOOST_PRAGMA_MESSAGE("Skipping test due to _LIBCPP_VERSION " BOOST_STRINGIZE(_LIBCPP_VERSION)) +int main() {} #else