From bdc734f1e0d88961b98ed29d440cd8e392f11a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sun, 30 Jun 2024 23:06:08 +0200 Subject: [PATCH] Avoid noisy warnings when instantiating BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH --- include/boost/container/allocator_traits.hpp | 5 +++-- include/boost/container/detail/workaround.hpp | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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