From 4341446e042af92ee08275f12f7412171d4b5da3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 18 Jun 2017 04:21:22 +0300 Subject: [PATCH] #ifdef constexpr tests on msvc and clang c++11 --- test/sp_constexpr_test.cpp | 16 ++++++++++++++++ test/sp_constexpr_test2.cpp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/test/sp_constexpr_test.cpp b/test/sp_constexpr_test.cpp index 1d345ea..20f8c85 100644 --- a/test/sp_constexpr_test.cpp +++ b/test/sp_constexpr_test.cpp @@ -9,8 +9,24 @@ // #include +#include + +#define HAVE_CONSTEXPR_INIT #if defined( BOOST_NO_CXX11_CONSTEXPR ) +# undef HAVE_CONSTEXPR_INIT +#endif + +#if BOOST_WORKAROUND( BOOST_MSVC, <= 1910 ) +# undef HAVE_CONSTEXPR_INIT +#endif + +#if defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) +// Clang 4+ in C++11 mode works too, but how to detect it? +# undef HAVE_CONSTEXPR_INIT +#endif + +#if !defined( HAVE_CONSTEXPR_INIT ) int main() { diff --git a/test/sp_constexpr_test2.cpp b/test/sp_constexpr_test2.cpp index 4e5cf37..238c8f4 100644 --- a/test/sp_constexpr_test2.cpp +++ b/test/sp_constexpr_test2.cpp @@ -9,8 +9,24 @@ // #include +#include + +#define HAVE_CONSTEXPR_INIT #if defined( BOOST_NO_CXX11_CONSTEXPR ) +# undef HAVE_CONSTEXPR_INIT +#endif + +#if BOOST_WORKAROUND( BOOST_MSVC, <= 1910 ) +# undef HAVE_CONSTEXPR_INIT +#endif + +#if defined(__clang__) && defined( BOOST_NO_CXX14_CONSTEXPR ) +// Clang 4+ in C++11 mode works too, but how to detect it? +# undef HAVE_CONSTEXPR_INIT +#endif + +#if !defined( HAVE_CONSTEXPR_INIT ) int main() {