Skip to content

Commit 1f54321

Browse files
committed
Disable Wdeprecated-declarations when using deprecated allocator
1 parent 65dc4d1 commit 1f54321

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

include/boost/container/allocator_traits.hpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,17 +533,35 @@ struct allocator_traits
533533
inline static pointer priv_allocate(dtl::false_type, Allocator &a, size_type n, const_void_pointer)
534534
{ return a.allocate(n); }
535535

536+
#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
537+
#pragma GCC diagnostic push
538+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
539+
#endif
540+
536541
template<class T>
537542
inline static void priv_destroy(dtl::true_type, Allocator &a, T* p) BOOST_NOEXCEPT_OR_NOTHROW
538543
{ a.destroy(p); }
539544

545+
#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
546+
#pragma GCC diagnostic pop
547+
#endif
548+
540549
template<class T>
541550
inline static void priv_destroy(dtl::false_type, Allocator &, T* p) BOOST_NOEXCEPT_OR_NOTHROW
542551
{ p->~T(); (void)p; }
543552

553+
#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
554+
#pragma GCC diagnostic push
555+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
556+
#endif
557+
544558
inline static size_type priv_max_size(dtl::true_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
545559
{ return a.max_size(); }
546560

561+
#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
562+
#pragma GCC diagnostic pop
563+
#endif
564+
547565
inline static size_type priv_max_size(dtl::false_type, const Allocator &) BOOST_NOEXCEPT_OR_NOTHROW
548566
{ return size_type(-1)/sizeof(value_type); }
549567

@@ -553,6 +571,12 @@ struct allocator_traits
553571
inline static const Allocator &priv_select_on_container_copy_construction(dtl::false_type, const Allocator &a) BOOST_NOEXCEPT_OR_NOTHROW
554572
{ return a; }
555573

574+
575+
#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
576+
#pragma GCC diagnostic push
577+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
578+
#endif
579+
556580
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
557581
template<class T, class ...Args>
558582
inline static void priv_construct(dtl::true_type, Allocator &a, T *p, BOOST_FWD_REF(Args) ...args)
@@ -598,6 +622,11 @@ struct allocator_traits
598622

599623
#endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
600624

625+
#if defined(BOOST_CONTAINER_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED)
626+
#pragma GCC diagnostic pop
627+
#endif
628+
629+
601630
template<class T>
602631
inline static void priv_construct(dtl::false_type, Allocator &, T *p, const ::boost::container::default_init_t&)
603632
{ ::new((void*)p, boost_container_new_t()) T; }

0 commit comments

Comments
 (0)