mirror of
https://github.com/boostorg/core.git
synced 2025-05-10 07:13:54 +00:00
Merge pull request #169 from k3DW/feature/168
Fix deprecated warning ignores in allocator_access.hpp
This commit is contained in:
commit
083b41c17e
@ -43,9 +43,17 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
|||||||
#if defined(_STL_DISABLE_DEPRECATED_WARNING)
|
#if defined(_STL_DISABLE_DEPRECATED_WARNING)
|
||||||
_STL_DISABLE_DEPRECATED_WARNING
|
_STL_DISABLE_DEPRECATED_WARNING
|
||||||
#endif
|
#endif
|
||||||
#if defined(_MSC_VER)
|
#if defined(__clang__) && defined(__has_warning)
|
||||||
#pragma warning(push)
|
# if __has_warning("-Wdeprecated-declarations")
|
||||||
#pragma warning(disable:4996)
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
# endif
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4996)
|
||||||
|
#elif defined(BOOST_GCC) && BOOST_GCC >= 40600
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
@ -807,8 +815,14 @@ using allocator_rebind_t = typename allocator_rebind<A, T>::type;
|
|||||||
|
|
||||||
} /* boost */
|
} /* boost */
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(__clang__) && defined(__has_warning)
|
||||||
#pragma warning(pop)
|
# if __has_warning("-Wdeprecated-declarations")
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
# endif
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# pragma warning(pop)
|
||||||
|
#elif defined(BOOST_GCC) && BOOST_GCC >= 40600
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
#if defined(_STL_RESTORE_DEPRECATED_WARNING)
|
#if defined(_STL_RESTORE_DEPRECATED_WARNING)
|
||||||
_STL_RESTORE_DEPRECATED_WARNING
|
_STL_RESTORE_DEPRECATED_WARNING
|
||||||
|
@ -265,6 +265,7 @@ run allocator_destroy_test.cpp ;
|
|||||||
run allocator_construct_n_test.cpp ;
|
run allocator_construct_n_test.cpp ;
|
||||||
run allocator_destroy_n_test.cpp ;
|
run allocator_destroy_n_test.cpp ;
|
||||||
run allocator_traits_test.cpp ;
|
run allocator_traits_test.cpp ;
|
||||||
|
compile allocator_pmr_test.cpp ;
|
||||||
|
|
||||||
lib lib_typeid : lib_typeid.cpp : <link>shared:<define>LIB_TYPEID_DYN_LINK=1 ;
|
lib lib_typeid : lib_typeid.cpp : <link>shared:<define>LIB_TYPEID_DYN_LINK=1 ;
|
||||||
|
|
||||||
|
22
test/allocator_pmr_test.cpp
Normal file
22
test/allocator_pmr_test.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//
|
||||||
|
// Testing stdlib polymorphic allocators
|
||||||
|
//
|
||||||
|
// Copyright 2024 Braden Ganetsky
|
||||||
|
//
|
||||||
|
// Distributed under 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
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <boost/core/allocator_access.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
|
||||||
|
#include <memory_resource>
|
||||||
|
|
||||||
|
void pmr_allocator_destroy_compiles(std::pmr::polymorphic_allocator<int>& alloc, int* p)
|
||||||
|
{
|
||||||
|
boost::allocator_destroy(alloc, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // !defined(BOOST_NO_CXX17_HDR_MEMORY_RESOURCE)
|
Loading…
x
Reference in New Issue
Block a user