Sync from upstream.

This commit is contained in:
Rene Rivera 2024-03-23 07:57:20 -05:00
commit 541745ea24
3 changed files with 43 additions and 6 deletions

View File

@ -43,9 +43,17 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
#if defined(_STL_DISABLE_DEPRECATED_WARNING)
_STL_DISABLE_DEPRECATED_WARNING
#endif
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996)
#if defined(__clang__) && defined(__has_warning)
# if __has_warning("-Wdeprecated-declarations")
# 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
namespace boost {
@ -807,9 +815,15 @@ using allocator_rebind_t = typename allocator_rebind<A, T>::type;
} /* boost */
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#if defined(__clang__) && defined(__has_warning)
# 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
#if defined(_STL_RESTORE_DEPRECATED_WARNING)
_STL_RESTORE_DEPRECATED_WARNING
#endif

View File

@ -268,6 +268,7 @@ run allocator_destroy_test.cpp ;
run allocator_construct_n_test.cpp ;
run allocator_destroy_n_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 ;

View 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)