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 | 30 +++++++++++++++--------------- test/sp_constexpr_test2.cpp | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/sp_constexpr_test.cpp b/test/sp_constexpr_test.cpp index da6c82e..d228636 100644 --- a/test/sp_constexpr_test.cpp +++ b/test/sp_constexpr_test.cpp @@ -10,26 +10,26 @@ #include #include - -#define HAVE_CONSTEXPR_INIT - -#if defined( BOOST_NO_CXX11_CONSTEXPR ) -# undef HAVE_CONSTEXPR_INIT -#endif +#include +#include #if BOOST_WORKAROUND( BOOST_MSVC, < 1930 ) -# undef HAVE_CONSTEXPR_INIT -#endif -#if defined(__clang__) && defined( BOOST_NO_CXX14_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 !defined( HAVE_CONSTEXPR_INIT ) +#elif defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) -int main() -{ -} +// 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() {} + +#elif defined( _LIBCPP_VERSION ) && ( _LIBCPP_VERSION < 6000 ) + +// 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 06ea6a1..ed52d91 100644 --- a/test/sp_constexpr_test2.cpp +++ b/test/sp_constexpr_test2.cpp @@ -10,26 +10,26 @@ #include #include - -#define HAVE_CONSTEXPR_INIT - -#if defined( BOOST_NO_CXX11_CONSTEXPR ) -# undef HAVE_CONSTEXPR_INIT -#endif +#include +#include #if BOOST_WORKAROUND( BOOST_MSVC, < 1930 ) -# undef HAVE_CONSTEXPR_INIT -#endif -#if defined(__clang__) && defined( BOOST_NO_CXX14_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 !defined( HAVE_CONSTEXPR_INIT ) +#elif defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) -int main() -{ -} +// 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() {} + +#elif defined( _LIBCPP_VERSION ) && ( _LIBCPP_VERSION < 6000 ) + +// 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