From 49dfd1f535ea906b2da10acfd2810aebd42c7c4d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 26 Mar 2020 18:15:53 +0000 Subject: [PATCH] Move C++03 deprecation warnings to separate file and only warn for headers that need it. --- include/boost/math/constants/constants.hpp | 1 + .../math/cstdfloat/cstdfloat_complex_std.hpp | 1 + .../math/distributions/hyperexponential.hpp | 1 + include/boost/math/quadrature/trapezoidal.hpp | 1 + include/boost/math/quaternion.hpp | 1 + .../detail/bernoulli_details.hpp | 1 + .../detail/unchecked_factorial.hpp | 1 + .../math/special_functions/lambert_w.hpp | 1 + .../boost/math/special_functions/legendre.hpp | 1 + include/boost/math/tools/atomic.hpp | 1 + include/boost/math/tools/config.hpp | 19 ------------ include/boost/math/tools/cxx03_warn.hpp | 30 +++++++++++++++++++ .../math/tools/detail/is_const_iterable.hpp | 3 ++ include/boost/math/tools/polynomial.hpp | 1 + include/boost/math/tools/recurrence.hpp | 1 + include/boost/math/tools/roots.hpp | 1 + include/boost/math/tools/tuple.hpp | 1 + 17 files changed, 47 insertions(+), 19 deletions(-) create mode 100644 include/boost/math/tools/cxx03_warn.hpp diff --git a/include/boost/math/constants/constants.hpp b/include/boost/math/constants/constants.hpp index 15e055888..6b57e4746 100644 --- a/include/boost/math/constants/constants.hpp +++ b/include/boost/math/constants/constants.hpp @@ -8,6 +8,7 @@ #define BOOST_MATH_CONSTANTS_CONSTANTS_INCLUDED #include +#include #include #include #include diff --git a/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp b/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp index e7765c58f..d5969975a 100644 --- a/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp +++ b/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp @@ -19,6 +19,7 @@ #include #include + #include namespace std { diff --git a/include/boost/math/distributions/hyperexponential.hpp b/include/boost/math/distributions/hyperexponential.hpp index 18cd048b8..2a3993a1f 100644 --- a/include/boost/math/distributions/hyperexponential.hpp +++ b/include/boost/math/distributions/hyperexponential.hpp @@ -17,6 +17,7 @@ #include +#include #include #include #include diff --git a/include/boost/math/quadrature/trapezoidal.hpp b/include/boost/math/quadrature/trapezoidal.hpp index 55c0b4f9b..2fa5814c2 100644 --- a/include/boost/math/quadrature/trapezoidal.hpp +++ b/include/boost/math/quadrature/trapezoidal.hpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace boost{ namespace math{ namespace quadrature { diff --git a/include/boost/math/quaternion.hpp b/include/boost/math/quaternion.hpp index 85187fc2f..1ba53ac63 100644 --- a/include/boost/math/quaternion.hpp +++ b/include/boost/math/quaternion.hpp @@ -25,6 +25,7 @@ #include // for the Sinus cardinal #include // for the Hyperbolic Sinus cardinal +#include #if defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_SFINAE_EXPR) #include diff --git a/include/boost/math/special_functions/detail/bernoulli_details.hpp b/include/boost/math/special_functions/detail/bernoulli_details.hpp index 75e9db051..4ab3e557c 100644 --- a/include/boost/math/special_functions/detail/bernoulli_details.hpp +++ b/include/boost/math/special_functions/detail/bernoulli_details.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include namespace boost{ namespace math{ namespace detail{ diff --git a/include/boost/math/special_functions/detail/unchecked_factorial.hpp b/include/boost/math/special_functions/detail/unchecked_factorial.hpp index a664b4564..09e3ee5eb 100644 --- a/include/boost/math/special_functions/detail/unchecked_factorial.hpp +++ b/include/boost/math/special_functions/detail/unchecked_factorial.hpp @@ -22,6 +22,7 @@ #endif #include #include +#include #ifdef BOOST_MATH_HAVE_CONSTEXPR_TABLES #include diff --git a/include/boost/math/special_functions/lambert_w.hpp b/include/boost/math/special_functions/lambert_w.hpp index cc907df5c..5cd50fba7 100644 --- a/include/boost/math/special_functions/lambert_w.hpp +++ b/include/boost/math/special_functions/lambert_w.hpp @@ -62,6 +62,7 @@ BOOST_MATH_INSTRUMENT_LAMBERT_W_SMALL_Z_SERIES_ITERATIONS // Show evaluation of #include #include // boost::math::tools::max_value(). #include +#include #include #include diff --git a/include/boost/math/special_functions/legendre.hpp b/include/boost/math/special_functions/legendre.hpp index 1596edabe..dd66d8a47 100644 --- a/include/boost/math/special_functions/legendre.hpp +++ b/include/boost/math/special_functions/legendre.hpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace boost{ namespace math{ diff --git a/include/boost/math/tools/atomic.hpp b/include/boost/math/tools/atomic.hpp index 29a48b824..d2b8022c6 100644 --- a/include/boost/math/tools/atomic.hpp +++ b/include/boost/math/tools/atomic.hpp @@ -8,6 +8,7 @@ #define BOOST_MATH_ATOMIC_DETAIL_HPP #include +#include #ifdef BOOST_HAS_THREADS diff --git a/include/boost/math/tools/config.hpp b/include/boost/math/tools/config.hpp index dcd50a312..9f5982256 100644 --- a/include/boost/math/tools/config.hpp +++ b/include/boost/math/tools/config.hpp @@ -26,25 +26,6 @@ # include #endif -#if defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_SFINAE_EXPR)\ - || defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || defined(BOOST_NO_CXX11_LAMBDAS) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)\ - || defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || defined(BOOST_NO_CXX11_HDR_CHRONO)\ - || defined(BOOST_NO_CXX11_THREAD_LOCAL) || defined(BOOST_NO_CXX11_CONSTEXPR) || defined(BOOST_NO_CXX11_NULLPTR)\ - || defined(BOOST_NO_CXX11_NUMERIC_LIMITS) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_HDR_ARRAY)\ - || defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_NOEXCEPT)\ - || defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) -// -// The above list includes everything we use, plus a few we're likely to use soon. -// As from March 2020, C++03 support is deprecated, and as from March 2021 will be removed, -// so mark up as such: -// -#if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(BOOST_MATH_DISABLE_DEPRECATED_03_WARNING) -#pragma message("CAUTION: One or more C++11 features were found to be unavailable") -#pragma message("CAUTION: Compiling Boost.Math in pre-C++11 conformance modes is now deprecated and will be removed from March 2021.") -#pragma message("CAUTION: Define BOOST_MATH_DISABLE_DEPRECATED_03_WARNING to suppress this message.") -#endif -#endif - #include #if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \ diff --git a/include/boost/math/tools/cxx03_warn.hpp b/include/boost/math/tools/cxx03_warn.hpp new file mode 100644 index 000000000..f40a35955 --- /dev/null +++ b/include/boost/math/tools/cxx03_warn.hpp @@ -0,0 +1,30 @@ +// Copyright (c) 2020 John Maddock +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MATH_TOOLS_CXX03_WARN_HPP +#define BOOST_MATH_TOOLS_CXX03_WARN_HPP + +#include + +#if defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_SFINAE_EXPR)\ + || defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || defined(BOOST_NO_CXX11_LAMBDAS) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)\ + || defined(BOOST_NO_CXX11_HDR_TUPLE) || defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || defined(BOOST_NO_CXX11_HDR_CHRONO)\ + || defined(BOOST_NO_CXX11_THREAD_LOCAL) || defined(BOOST_NO_CXX11_CONSTEXPR) || defined(BOOST_NO_CXX11_NULLPTR)\ + || defined(BOOST_NO_CXX11_NUMERIC_LIMITS) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_HDR_ARRAY)\ + || defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_NOEXCEPT)\ + || defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) +// +// The above list includes everything we use, plus a few we're likely to use soon. +// As from March 2020, C++03 support is deprecated, and as from March 2021 will be removed, +// so mark up as such: +// +#if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(BOOST_MATH_DISABLE_DEPRECATED_03_WARNING) +BOOST_PRAGMA_MESSAGE("CAUTION: One or more C++11 features were found to be unavailable") +BOOST_PRAGMA_MESSAGE("CAUTION: Compiling Boost.Math in pre-C++11 conformance modes is now deprecated and will be removed from March 2021.") +BOOST_PRAGMA_MESSAGE("CAUTION: Define BOOST_MATH_DISABLE_DEPRECATED_03_WARNING to suppress this message.") +#endif +#endif + +#endif diff --git a/include/boost/math/tools/detail/is_const_iterable.hpp b/include/boost/math/tools/detail/is_const_iterable.hpp index 805b66e22..7d04adb1f 100644 --- a/include/boost/math/tools/detail/is_const_iterable.hpp +++ b/include/boost/math/tools/detail/is_const_iterable.hpp @@ -6,6 +6,9 @@ #ifndef BOOST_MATH_TOOLS_IS_CONST_ITERABLE_HPP #define BOOST_MATH_TOOLS_IS_CONST_ITERABLE_HPP +#include +#include + #if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_SFINAE_EXPR) #define BOOST_MATH_HAS_IS_CONST_ITERABLE diff --git a/include/boost/math/tools/polynomial.hpp b/include/boost/math/tools/polynomial.hpp index 80f17a2f7..5e927c37d 100644 --- a/include/boost/math/tools/polynomial.hpp +++ b/include/boost/math/tools/polynomial.hpp @@ -15,6 +15,7 @@ #include #include +#include #ifdef BOOST_NO_CXX11_LAMBDAS #include #endif diff --git a/include/boost/math/tools/recurrence.hpp b/include/boost/math/tools/recurrence.hpp index d30130872..410238047 100644 --- a/include/boost/math/tools/recurrence.hpp +++ b/include/boost/math/tools/recurrence.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #ifdef BOOST_NO_CXX11_HDR_TUPLE #error "This header requires C++11 support" diff --git a/include/boost/math/tools/roots.hpp b/include/boost/math/tools/roots.hpp index 145f4947f..853334b04 100644 --- a/include/boost/math/tools/roots.hpp +++ b/include/boost/math/tools/roots.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef BOOST_MSVC #pragma warning(push) diff --git a/include/boost/math/tools/tuple.hpp b/include/boost/math/tools/tuple.hpp index 81de59fa3..7ca57a1b6 100644 --- a/include/boost/math/tools/tuple.hpp +++ b/include/boost/math/tools/tuple.hpp @@ -7,6 +7,7 @@ # define BOOST_MATH_TUPLE_HPP_INCLUDED # include # include +# include #if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500)