diff --git a/include/boost/container/allocator_traits.hpp b/include/boost/container/allocator_traits.hpp index 1fefda53..dd5bf0e4 100644 --- a/include/boost/container/allocator_traits.hpp +++ b/include/boost/container/allocator_traits.hpp @@ -49,9 +49,10 @@ #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED -#if defined(BOOST_GCC) && (BOOST_GCC >= 40600) +#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME allocate @@ -75,7 +76,7 @@ #define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_MAX 9 #include -#if defined(BOOST_GCC) && (BOOST_GCC >= 40600) +#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED) #pragma GCC diagnostic pop #endif diff --git a/include/boost/container/detail/workaround.hpp b/include/boost/container/detail/workaround.hpp index 6beb7c26..d6407d4d 100644 --- a/include/boost/container/detail/workaround.hpp +++ b/include/boost/container/detail/workaround.hpp @@ -236,4 +236,8 @@ namespace boost { # define BOOST_CONTAINER_CONSTANT_VAR static BOOST_CONSTEXPR_OR_CONST #endif +#if defined(__GNUC__) && ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600) +#define BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED +#endif + #endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP