[libcxx-commits] [libcxx] 12bb291 - [libc++] Remove experimental pmr headers now shipped in mainline (#73172)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Nov 27 07:54:41 PST 2023
Author: Louis Dionne
Date: 2023-11-27T10:54:35-05:00
New Revision: 12bb2910c3e339730279f65b2c0813ccfce024f1
URL: https://github.com/llvm/llvm-project/commit/12bb2910c3e339730279f65b2c0813ccfce024f1
DIFF: https://github.com/llvm/llvm-project/commit/12bb2910c3e339730279f65b2c0813ccfce024f1.diff
LOG: [libc++] Remove experimental pmr headers now shipped in mainline (#73172)
Several experimental headers around std::pmr have been slated for
removal for a while now. This patch actually performs the removal and
cleanups from the code base.
Added:
libcxx/src/experimental/keep.cpp
Modified:
libcxx/docs/DesignDocs/ExperimentalFeatures.rst
libcxx/docs/ReleaseNotes/18.rst
libcxx/include/CMakeLists.txt
libcxx/include/__std_clang_module
libcxx/include/experimental/__config
libcxx/include/module.modulemap.in
libcxx/src/CMakeLists.txt
libcxx/test/libcxx/transitive_includes/cxx03.csv
libcxx/test/libcxx/transitive_includes/cxx11.csv
libcxx/test/libcxx/transitive_includes/cxx14.csv
libcxx/test/libcxx/transitive_includes/cxx17.csv
libcxx/test/libcxx/transitive_includes/cxx20.csv
libcxx/test/libcxx/transitive_includes/cxx23.csv
libcxx/test/libcxx/transitive_includes/cxx26.csv
libcxx/test/support/uses_alloc_types.h
libcxx/utils/libcxx/header_information.py
Removed:
libcxx/include/experimental/deque
libcxx/include/experimental/forward_list
libcxx/include/experimental/list
libcxx/include/experimental/map
libcxx/include/experimental/memory_resource
libcxx/include/experimental/regex
libcxx/include/experimental/set
libcxx/include/experimental/string
libcxx/include/experimental/unordered_map
libcxx/include/experimental/unordered_set
libcxx/include/experimental/vector
libcxx/src/experimental/memory_resource.cpp
libcxx/src/experimental/memory_resource_init_helper.h
libcxx/test/libcxx/experimental/lit.local.cfg
libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/copy.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/memory_resource_convert.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/other_alloc.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.overview/nothing_to_do.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_copy.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_move.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/default.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_allocate_and_deallocate.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_is_equal.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.overview/overview.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
libcxx/test/std/experimental/memory/memory.resource.synop/nothing_to_do.pass.cpp
libcxx/test/std/experimental/memory/memory.resource/construct.verify.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/equal.pass.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/not_equal.pass.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.overview/nothing_to_do.pass.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/private_members.verify.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/deallocate.pass.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/dtor.pass.cpp
libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/is_equal.pass.cpp
libcxx/test/support/test_memory_resource.h
################################################################################
diff --git a/libcxx/docs/DesignDocs/ExperimentalFeatures.rst b/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
index 4cd6bf3a7fcd50d..dc2ae6a25aa5d01 100644
--- a/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
+++ b/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
@@ -106,19 +106,19 @@ Most (but not all) of the features of the LFTS were accepted into C++17.
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
| 8.2.2 | ``weak_ptr`` enhancements | Not yet | Never added | |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.5 | ``memory_resource`` | Not yet | | |
+| 8.5 | ``memory_resource`` | 16.0 | 18.0 | Removed |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.6 | ``polymorphic_allocator`` | Not yet | | |
+| 8.6 | ``polymorphic_allocator`` | 16.0 | 18.0 | Removed |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
| 8.7 | ``resource_adaptor`` | | n/a | Not part of C++17 |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.8 | Access to program-wide ``memory_resource`` objects | Not yet | | |
+| 8.8 | Access to program-wide ``memory_resource`` objects | 16.0 | 18.0 | Removed |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.9 | Pool resource classes | Not yet | | |
+| 8.9 | Pool resource classes | 16.0 | 18.0 | Removed |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.10 | ``monotonic_buffer_resource`` | Not yet | | |
+| 8.10 | ``monotonic_buffer_resource`` | 16.0 | 18.0 | Removed |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.11 | Alias templates using polymorphic memory resources | Not yet | | |
+| 8.11 | Alias templates using polymorphic memory resources | 16.0 | 18.0 | Removed |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
| 8.12 | Non-owning pointers | | n/a | Not part of C++17 |
+---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 7c4b578bd6fa3ec..3a298da6691c08d 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -101,17 +101,14 @@ Deprecations and Removals
Please see the updated documentation about the hardening modes in libc++ and in particular the
``_LIBCPP_VERBOSE_ABORT`` macro for details.
-Upcoming Deprecations and Removals
-----------------------------------
-
-LLVM 18
-~~~~~~~
-
- The headers ``<experimental/deque>``, ``<experimental/forward_list>``, ``<experimental/list>``,
``<experimental/map>``, ``<experimental/memory_resource>``, ``<experimental/regex>``, ``<experimental/set>``,
``<experimental/string>``, ``<experimental/unordered_map>``, ``<experimental/unordered_set>``,
- and ``<experimental/vector>`` will be removed in LLVM 18, as all their contents will have been implemented in
- namespace ``std`` for at least two releases.
+ and ``<experimental/vector>`` have been removed in LLVM 18, as all their contents will have been
+ implemented in namespace ``std`` for at least two releases.
+
+Upcoming Deprecations and Removals
+----------------------------------
LLVM 19
~~~~~~~
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index ab3cc73f531ce89..15d4537518d31e8 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -920,23 +920,12 @@ set(files
experimental/__simd/traits.h
experimental/__simd/utility.h
experimental/__simd/vec_ext.h
- experimental/deque
- experimental/forward_list
experimental/iterator
- experimental/list
- experimental/map
experimental/memory
- experimental/memory_resource
experimental/propagate_const
- experimental/regex
- experimental/set
experimental/simd
- experimental/string
experimental/type_traits
- experimental/unordered_map
- experimental/unordered_set
experimental/utility
- experimental/vector
ext/__hash
ext/hash_map
ext/hash_set
diff --git a/libcxx/include/__std_clang_module b/libcxx/include/__std_clang_module
index 10ac3ccb8f329f4..18d6ce6b46c1f6e 100644
--- a/libcxx/include/__std_clang_module
+++ b/libcxx/include/__std_clang_module
@@ -86,25 +86,12 @@
#include <exception>
#include <execution>
#include <expected>
-#include <experimental/deque>
-#include <experimental/forward_list>
#include <experimental/iterator>
-#include <experimental/list>
-#include <experimental/map>
#include <experimental/memory>
-#include <experimental/memory_resource>
#include <experimental/propagate_const>
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-# include <experimental/regex>
-#endif
-#include <experimental/set>
#include <experimental/simd>
-#include <experimental/string>
#include <experimental/type_traits>
-#include <experimental/unordered_map>
-#include <experimental/unordered_set>
#include <experimental/utility>
-#include <experimental/vector>
#include <fenv.h>
#include <filesystem>
#include <float.h>
diff --git a/libcxx/include/experimental/__config b/libcxx/include/experimental/__config
index 65227c8b4052049..c86fd36dc558ea7 100644
--- a/libcxx/include/experimental/__config
+++ b/libcxx/include/experimental/__config
@@ -28,10 +28,6 @@
#define _LIBCPP_END_NAMESPACE_LFTS_V2 } } }
#define _VSTD_LFTS_V2 _VSTD_EXPERIMENTAL::fundamentals_v2
-#define _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR _LIBCPP_BEGIN_NAMESPACE_LFTS namespace pmr {
-#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
-#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
-
// TODO: support more targets
#if defined(__AVX__)
#define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
diff --git a/libcxx/include/experimental/deque b/libcxx/include/experimental/deque
deleted file mode 100644
index 46962afbb795eb4..000000000000000
--- a/libcxx/include/experimental/deque
+++ /dev/null
@@ -1,52 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_DEQUE
-#define _LIBCPP_EXPERIMENTAL_DEQUE
-
-/*
- experimental/deque synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class T>
- using deque = std::deque<T,polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <deque>
-#include <experimental/__config>
-#include <experimental/memory_resource>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _ValueT>
-using deque = _VSTD::deque<_ValueT, polymorphic_allocator<_ValueT>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_DEQUE */
diff --git a/libcxx/include/experimental/forward_list b/libcxx/include/experimental/forward_list
deleted file mode 100644
index 5d2686deb27681f..000000000000000
--- a/libcxx/include/experimental/forward_list
+++ /dev/null
@@ -1,52 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_FORWARD_LIST
-#define _LIBCPP_EXPERIMENTAL_FORWARD_LIST
-
-/*
- experimental/forward_list synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class T>
- using forward_list = std::forward_list<T,polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <forward_list>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _ValueT>
-using forward_list = _VSTD::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_FORWARD_LIST */
diff --git a/libcxx/include/experimental/list b/libcxx/include/experimental/list
deleted file mode 100644
index 06abe8702241e35..000000000000000
--- a/libcxx/include/experimental/list
+++ /dev/null
@@ -1,52 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_LIST
-#define _LIBCPP_EXPERIMENTAL_LIST
-
-/*
- experimental/list synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class T>
- using list = std::list<T,polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <list>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _ValueT>
-using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_LIST */
diff --git a/libcxx/include/experimental/map b/libcxx/include/experimental/map
deleted file mode 100644
index 8ec94e4a5bc86dd..000000000000000
--- a/libcxx/include/experimental/map
+++ /dev/null
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_MAP
-#define _LIBCPP_EXPERIMENTAL_MAP
-
-/*
- experimental/map synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class Key, class T, class Compare = less<Key>>
- using map = std::map<Key, T, Compare,
- polymorphic_allocator<pair<const Key,T>>>;
-
- template <class Key, class T, class Compare = less<Key>>
- using multimap = std::multimap<Key, T, Compare,
- polymorphic_allocator<pair<const Key,T>>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <map>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Value, class _Compare = less<_Key>>
-using map = _VSTD::map<_Key, _Value, _Compare,
- polymorphic_allocator<pair<const _Key, _Value>>>;
-
-template <class _Key, class _Value, class _Compare = less<_Key>>
-using multimap = _VSTD::multimap<_Key, _Value, _Compare,
- polymorphic_allocator<pair<const _Key, _Value>>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_MAP */
diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource
deleted file mode 100644
index 8ae8322ae1a63e9..000000000000000
--- a/libcxx/include/experimental/memory_resource
+++ /dev/null
@@ -1,444 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE
-#define _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE
-
-/**
- experimental/memory_resource synopsis
-
-// C++1y
-
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- class memory_resource;
-
- bool operator==(const memory_resource& a,
- const memory_resource& b) noexcept;
- bool operator!=(const memory_resource& a,
- const memory_resource& b) noexcept;
-
- template <class Tp> class polymorphic_allocator;
-
- template <class T1, class T2>
- bool operator==(const polymorphic_allocator<T1>& a,
- const polymorphic_allocator<T2>& b) noexcept;
- template <class T1, class T2>
- bool operator!=(const polymorphic_allocator<T1>& a,
- const polymorphic_allocator<T2>& b) noexcept;
-
- // The name resource_adaptor_imp is for exposition only.
- template <class Allocator> class resource_adaptor_imp;
-
- template <class Allocator>
- using resource_adaptor = resource_adaptor_imp<
- allocator_traits<Allocator>::rebind_alloc<char>>;
-
- // Global memory resources
- memory_resource* new_delete_resource() noexcept;
- memory_resource* null_memory_resource() noexcept;
-
- // The default memory resource
- memory_resource* set_default_resource(memory_resource* r) noexcept;
- memory_resource* get_default_resource() noexcept;
-
- // Standard memory resources
- struct pool_options;
- class synchronized_pool_resource;
- class unsynchronized_pool_resource;
- class monotonic_buffer_resource;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <__memory/allocator_traits.h>
-#include <__type_traits/aligned_storage.h>
-#include <__utility/move.h>
-#include <cstddef>
-#include <experimental/__config>
-#include <experimental/__memory>
-#include <limits>
-#include <new>
-#include <stdexcept>
-#include <tuple>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#define _LIBCPP_DEPCREATED_MEMORY_RESOURCE(name) \
- _LIBCPP_DEPRECATED_("'std::experimental::pmr::" name \
- "' is deprecated and will be removed in LLVM 18. Use 'std::pmr::" name "' instead.")
-
-#ifndef _LIBCPP_CXX03_LANG
-
-// Round __s up to next multiple of __a.
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __aligned_allocation_size(size_t __s, size_t __a) _NOEXCEPT
-{
- _LIBCPP_ASSERT_UNCATEGORIZED(__s + __a > __s, "aligned allocation size overflows");
- return (__s + __a - 1) & ~(__a - 1);
-}
-
-// 8.5, memory.resource
-class _LIBCPP_DEPCREATED_MEMORY_RESOURCE("memory_resource") _LIBCPP_EXPORTED_FROM_ABI memory_resource
-{
- static const size_t __max_align = _LIBCPP_ALIGNOF(max_align_t);
-
-// 8.5.2, memory.resource.public
-public:
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~memory_resource() = default;
-
- _LIBCPP_INLINE_VISIBILITY
- void* allocate(size_t __bytes, size_t __align = __max_align)
- { return do_allocate(__bytes, __align); }
-
- _LIBCPP_INLINE_VISIBILITY
- void deallocate(void * __p, size_t __bytes, size_t __align = __max_align)
- { do_deallocate(__p, __bytes, __align); }
-
- _LIBCPP_INLINE_VISIBILITY
- bool is_equal(memory_resource const & __other) const _NOEXCEPT
- { return do_is_equal(__other); }
-
-// 8.5.3, memory.resource.priv
-private:
- virtual void* do_allocate(size_t, size_t) = 0;
- virtual void do_deallocate(void*, size_t, size_t) = 0;
- virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;
-};
-
-// 8.5.4, memory.resource.eq
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator==(memory_resource, memory_resource)") inline _LIBCPP_INLINE_VISIBILITY
-bool operator==(memory_resource const & __lhs,
- memory_resource const & __rhs) _NOEXCEPT
-{
- return &__lhs == &__rhs || __lhs.is_equal(__rhs);
-}
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator!=(memory_resource, memory_resource)") inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(memory_resource const & __lhs,
- memory_resource const & __rhs) _NOEXCEPT
-{
- return !(__lhs == __rhs);
-}
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("new_delete_resource()") _LIBCPP_EXPORTED_FROM_ABI
-memory_resource * new_delete_resource() _NOEXCEPT;
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("null_memory_resource()") _LIBCPP_EXPORTED_FROM_ABI
-memory_resource * null_memory_resource() _NOEXCEPT;
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("get_default_resource()") _LIBCPP_EXPORTED_FROM_ABI
-memory_resource * get_default_resource() _NOEXCEPT;
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("set_default_resource()") _LIBCPP_EXPORTED_FROM_ABI
-memory_resource * set_default_resource(memory_resource * __new_res) _NOEXCEPT;
-
-// 8.6, memory.polymorphic.allocator.class
-
-// 8.6.1, memory.polymorphic.allocator.overview
-template <class _ValueType>
-class _LIBCPP_DEPCREATED_MEMORY_RESOURCE("polymorphic_allocator") _LIBCPP_TEMPLATE_VIS polymorphic_allocator
-{
-public:
- typedef _ValueType value_type;
-
- // 8.6.2, memory.polymorphic.allocator.ctor
- _LIBCPP_INLINE_VISIBILITY
- polymorphic_allocator() _NOEXCEPT
- : __res_(_VSTD_LFTS_PMR::get_default_resource())
- {}
-
- _LIBCPP_INLINE_VISIBILITY
- polymorphic_allocator(memory_resource * __r) _NOEXCEPT
- : __res_(__r)
- {}
-
- _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(polymorphic_allocator const &) = default;
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- polymorphic_allocator(polymorphic_allocator<_Tp> const & __other) _NOEXCEPT
- : __res_(__other.resource())
- {}
-
- polymorphic_allocator &
- operator=(polymorphic_allocator const &) = delete;
-
- // 8.6.3, memory.polymorphic.allocator.mem
- _LIBCPP_INLINE_VISIBILITY
- _ValueType* allocate(size_t __n) {
- if (__n > __max_size())
- __throw_bad_array_new_length();
- return static_cast<_ValueType*>(
- __res_->allocate(__n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType))
- );
- }
-
- _LIBCPP_INLINE_VISIBILITY
- void deallocate(_ValueType * __p, size_t __n) _NOEXCEPT {
- _LIBCPP_ASSERT_UNCATEGORIZED(__n <= __max_size(),
- "deallocate called for size which exceeds max_size()");
- __res_->deallocate(__p, __n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType));
- }
-
- template <class _Tp, class ..._Ts>
- _LIBCPP_INLINE_VISIBILITY
- void construct(_Tp* __p, _Ts &&... __args)
- {
- _VSTD_LFTS::__lfts_user_alloc_construct(
- __p, *this, _VSTD::forward<_Ts>(__args)...
- );
- }
-
- template <class _T1, class _T2, class ..._Args1, class ..._Args2>
- _LIBCPP_INLINE_VISIBILITY
- void construct(pair<_T1, _T2>* __p, piecewise_construct_t,
- tuple<_Args1...> __x, tuple<_Args2...> __y)
- {
- ::new ((void*)__p) pair<_T1, _T2>(piecewise_construct
- , __transform_tuple(
- typename __lfts_uses_alloc_ctor<
- _T1, polymorphic_allocator&, _Args1...
- >::type()
- , _VSTD::move(__x)
- , typename __make_tuple_indices<sizeof...(_Args1)>::type{}
- )
- , __transform_tuple(
- typename __lfts_uses_alloc_ctor<
- _T2, polymorphic_allocator&, _Args2...
- >::type()
- , _VSTD::move(__y)
- , typename __make_tuple_indices<sizeof...(_Args2)>::type{}
- )
- );
- }
-
- template <class _T1, class _T2>
- _LIBCPP_INLINE_VISIBILITY
- void construct(pair<_T1, _T2>* __p) {
- construct(__p, piecewise_construct, tuple<>(), tuple<>());
- }
-
- template <class _T1, class _T2, class _Up, class _Vp>
- _LIBCPP_INLINE_VISIBILITY
- void construct(pair<_T1, _T2> * __p, _Up && __u, _Vp && __v) {
- construct(__p, piecewise_construct
- , _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__u))
- , _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__v)));
- }
-
- template <class _T1, class _T2, class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY
- void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> const & __pr) {
- construct(__p, piecewise_construct
- , _VSTD::forward_as_tuple(__pr.first)
- , _VSTD::forward_as_tuple(__pr.second));
- }
-
- template <class _T1, class _T2, class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY
- void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> && __pr){
- construct(__p, piecewise_construct
- , _VSTD::forward_as_tuple(_VSTD::forward<_U1>(__pr.first))
- , _VSTD::forward_as_tuple(_VSTD::forward<_U2>(__pr.second)));
- }
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- void destroy(_Tp * __p) _NOEXCEPT
- { __p->~_Tp(); }
-
- _LIBCPP_INLINE_VISIBILITY
- polymorphic_allocator
- select_on_container_copy_construction() const _NOEXCEPT
- { return polymorphic_allocator(); }
-
- _LIBCPP_INLINE_VISIBILITY
- memory_resource * resource() const _NOEXCEPT
- { return __res_; }
-
-private:
- template <class ..._Args, size_t ..._Idx>
- _LIBCPP_INLINE_VISIBILITY
- tuple<_Args&&...>
- __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t,
- __tuple_indices<_Idx...>) const
- {
- return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...);
- }
-
- template <class ..._Args, size_t ..._Idx>
- _LIBCPP_INLINE_VISIBILITY
- tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>
- __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t,
- __tuple_indices<_Idx...>)
- {
- using _Tup = tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>;
- return _Tup(allocator_arg, *this,
- _VSTD::get<_Idx>(_VSTD::move(__t))...);
- }
-
- template <class ..._Args, size_t ..._Idx>
- _LIBCPP_INLINE_VISIBILITY
- tuple<_Args&&..., polymorphic_allocator&>
- __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t,
- __tuple_indices<_Idx...>)
- {
- using _Tup = tuple<_Args&&..., polymorphic_allocator&>;
- return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., *this);
- }
-
- _LIBCPP_INLINE_VISIBILITY
- size_t __max_size() const _NOEXCEPT
- { return numeric_limits<size_t>::max() / sizeof(value_type); }
-
- memory_resource * __res_;
-};
-
-// 8.6.4, memory.polymorphic.allocator.eq
-
-template <class _Tp, class _Up>
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator==(const polymorphic_allocator&, const polymorphic_allocator&)")
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator==(polymorphic_allocator<_Tp> const & __lhs,
- polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT
-{
- return *__lhs.resource() == *__rhs.resource();
-}
-
-template <class _Tp, class _Up>
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator!=(const polymorphic_allocator&, const polymorphic_allocator&)")
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(polymorphic_allocator<_Tp> const & __lhs,
- polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT
-{
- return !(__lhs == __rhs);
-}
-
-// 8.7, memory.resource.adaptor
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-// 8.7.1, memory.resource.adaptor.overview
-template <class _CharAlloc>
-class _LIBCPP_TEMPLATE_VIS __resource_adaptor_imp
- : public memory_resource
-{
- using _CTraits = allocator_traits<_CharAlloc>;
- static_assert(is_same<typename _CTraits::value_type, char>::value
- && is_same<typename _CTraits::pointer, char*>::value
- && is_same<typename _CTraits::void_pointer, void*>::value, "");
-
- static const size_t _MaxAlign = _LIBCPP_ALIGNOF(max_align_t);
-
- using _Alloc = typename _CTraits::template rebind_alloc<
- typename aligned_storage<_MaxAlign, _MaxAlign>::type
- >;
-
- using _ValueType = typename _Alloc::value_type;
-
- _Alloc __alloc_;
-
-public:
- typedef _CharAlloc allocator_type;
-
- _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp() = default;
- _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp(__resource_adaptor_imp const &) = default;
- _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp(__resource_adaptor_imp &&) = default;
-
- // 8.7.2, memory.resource.adaptor.ctor
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __resource_adaptor_imp(allocator_type const & __a)
- : __alloc_(__a)
- {}
-
- _LIBCPP_INLINE_VISIBILITY
- explicit __resource_adaptor_imp(allocator_type && __a)
- : __alloc_(_VSTD::move(__a))
- {}
-
- _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp &
- operator=(__resource_adaptor_imp const &) = default;
-
- _LIBCPP_INLINE_VISIBILITY
- allocator_type get_allocator() const
- { return __alloc_; }
-
-// 8.7.3, memory.resource.adaptor.mem
-private:
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL void * do_allocate(size_t __bytes, size_t) override
- {
- if (__bytes > __max_size())
- __throw_bad_array_new_length();
- size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
- return __alloc_.allocate(__s);
- }
-
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void * __p, size_t __bytes, size_t) override
- {
- _LIBCPP_ASSERT_UNCATEGORIZED(__bytes <= __max_size(),
- "do_deallocate called for size which exceeds the maximum allocation size");
- size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
- __alloc_.deallocate((_ValueType*)__p, __s);
- }
-
- _LIBCPP_HIDE_FROM_ABI_VIRTUAL bool do_is_equal(memory_resource const & __other) const _NOEXCEPT override {
- __resource_adaptor_imp const * __p
- = dynamic_cast<__resource_adaptor_imp const *>(&__other);
- return __p ? __alloc_ == __p->__alloc_ : false;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- size_t __max_size() const _NOEXCEPT {
- return numeric_limits<size_t>::max() - _MaxAlign;
- }
-};
-
-template <class _Alloc>
-using resource_adaptor = __resource_adaptor_imp<
- typename allocator_traits<_Alloc>::template rebind_alloc<char>
- >;
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-_LIBCPP_POP_MACROS
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <atomic>
-# include <climits>
-# include <concepts>
-# include <cstdlib>
-# include <cstring>
-# include <ctime>
-# include <iterator>
-# include <memory>
-# include <ratio>
-# include <type_traits>
-# include <variant>
-#endif
-
-#endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */
diff --git a/libcxx/include/experimental/regex b/libcxx/include/experimental/regex
deleted file mode 100644
index 0c871f366dc8903..000000000000000
--- a/libcxx/include/experimental/regex
+++ /dev/null
@@ -1,69 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_REGEX
-#define _LIBCPP_EXPERIMENTAL_REGEX
-
-/*
- experimental/regex synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class BidirectionalIterator>
- using match_results =
- std::match_results<BidirectionalIterator,
- polymorphic_allocator<sub_match<BidirectionalIterator>>>;
-
- typedef match_results<const char*> cmatch;
- typedef match_results<const wchar_t*> wcmatch;
- typedef match_results<string::const_iterator> smatch;
- typedef match_results<wstring::const_iterator> wsmatch;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <experimental/string>
-#include <regex>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _BiDirIter>
-using match_results =
- _VSTD::match_results<_BiDirIter,
- polymorphic_allocator<_VSTD::sub_match<_BiDirIter>>>;
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("cmatch") typedef match_results<const char*> cmatch;
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("smatch") typedef match_results<_VSTD_LFTS_PMR::string::const_iterator> smatch;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("wcmatch") typedef match_results<const wchar_t*> wcmatch;
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("wsmatch") typedef match_results<_VSTD_LFTS_PMR::wstring::const_iterator> wsmatch;
-#endif
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_REGEX */
diff --git a/libcxx/include/experimental/set b/libcxx/include/experimental/set
deleted file mode 100644
index cd61e6449597bf4..000000000000000
--- a/libcxx/include/experimental/set
+++ /dev/null
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_SET
-#define _LIBCPP_EXPERIMENTAL_SET
-
-/*
- experimental/set synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class Key, class T, class Compare = less<Key>>
- using set = std::set<Key, T, Compare,
- polymorphic_allocator<pair<const Key,T>>>;
-
- template <class Key, class T, class Compare = less<Key>>
- using multiset = std::multiset<Key, T, Compare,
- polymorphic_allocator<pair<const Key,T>>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <set>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Value, class _Compare = less<_Value>>
-using set = _VSTD::set<_Value, _Compare,
- polymorphic_allocator<_Value>>;
-
-template <class _Value, class _Compare = less<_Value>>
-using multiset = _VSTD::multiset<_Value, _Compare,
- polymorphic_allocator<_Value>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_SET */
diff --git a/libcxx/include/experimental/string b/libcxx/include/experimental/string
deleted file mode 100644
index 4edbf98b5f73b19..000000000000000
--- a/libcxx/include/experimental/string
+++ /dev/null
@@ -1,73 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_STRING
-#define _LIBCPP_EXPERIMENTAL_STRING
-
-/*
- experimental/string synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- // basic_string using polymorphic allocator in namespace pmr
- template <class charT, class traits = char_traits<charT>>
- using basic_string =
- std::basic_string<charT, traits, polymorphic_allocator<charT>>;
-
- // basic_string typedef names using polymorphic allocator in namespace
- // std::experimental::pmr
- typedef basic_string<char> string;
- typedef basic_string<char16_t> u16string;
- typedef basic_string<char32_t> u32string;
- typedef basic_string<wchar_t> wstring;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <string>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-
-template <class _CharT, class _Traits = char_traits<_CharT>>
-using basic_string =
- _VSTD::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("string") typedef basic_string<char> string;
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("u16string") typedef basic_string<char16_t> u16string;
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("u32string") typedef basic_string<char32_t> u32string;
-#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("wstring") typedef basic_string<wchar_t> wstring;
-#endif
-
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_STRING */
diff --git a/libcxx/include/experimental/unordered_map b/libcxx/include/experimental/unordered_map
deleted file mode 100644
index d2801822a56fa7c..000000000000000
--- a/libcxx/include/experimental/unordered_map
+++ /dev/null
@@ -1,78 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_MAP
-#define _LIBCPP_EXPERIMENTAL_UNORDERED_MAP
-
-/*
- experimental/unordered_map synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class Key, class T,
- class Hash = hash<Key>,
- class Pred = equal_to<Key>>
- using unordered_map =
- std::unordered_map<Key, T, Hash, Pred,
- polymorphic_allocator<pair<const Key,T>>>;
-
- template <class Key, class T,
- class Hash = hash<Key>,
- class Pred = equal_to<Key>>
- using unordered_multimap =
- std::unordered_multimap<Key, T, Hash, Pred,
- polymorphic_allocator<pair<const Key,T>>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <unordered_map>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Value,
- class _Hash = hash<_Key>, class _Pred = equal_to<_Key>>
-using unordered_map = _VSTD::unordered_map<_Key, _Value, _Hash, _Pred,
- polymorphic_allocator<pair<const _Key, _Value>>>;
-
-template <class _Key, class _Value,
- class _Hash = hash<_Key>, class _Pred = equal_to<_Key>>
-using unordered_multimap = _VSTD::unordered_multimap<_Key, _Value, _Hash, _Pred,
- polymorphic_allocator<pair<const _Key, _Value>>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
-# include <algorithm>
-# include <array>
-# include <bit>
-# include <functional>
-# include <vector>
-#endif
-
-#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_MAP */
diff --git a/libcxx/include/experimental/unordered_set b/libcxx/include/experimental/unordered_set
deleted file mode 100644
index 493e3a09ed109ca..000000000000000
--- a/libcxx/include/experimental/unordered_set
+++ /dev/null
@@ -1,64 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_SET
-#define _LIBCPP_EXPERIMENTAL_UNORDERED_SET
-
-/*
- experimental/unordered_set synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class T, class Hash = hash<T>, class Pred = equal_to<T>>
- using unordered_set = std::unordered_set<T, Hash, Pred,
- polymorphic_allocator<T>>;
-
- template <class T, class Hash = hash<T>, class Pred = equal_to<T>>
- using unordered_multiset = std::unordered_multiset<T, Hash, Pred,
- polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <unordered_set>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Value,
- class _Hash = hash<_Value>, class _Pred = equal_to<_Value>>
-using unordered_set = _VSTD::unordered_set<_Value, _Hash, _Pred,
- polymorphic_allocator<_Value>>;
-
-template <class _Value,
- class _Hash = hash<_Value>, class _Pred = equal_to<_Value>>
-using unordered_multiset = _VSTD::unordered_multiset<_Value, _Hash, _Pred,
- polymorphic_allocator<_Value>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_SET */
diff --git a/libcxx/include/experimental/vector b/libcxx/include/experimental/vector
deleted file mode 100644
index 2e9d77e41af281a..000000000000000
--- a/libcxx/include/experimental/vector
+++ /dev/null
@@ -1,52 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_VECTOR
-#define _LIBCPP_EXPERIMENTAL_VECTOR
-
-/*
- experimental/vector synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
- template <class T>
- using vector = std::vector<T, polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <vector>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _ValueT>
-using vector = _VSTD::vector<_ValueT, polymorphic_allocator<_ValueT>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_VECTOR */
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index 996e060281c9c9b..cdf92c45ebca974 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -517,43 +517,18 @@ module std_wctype_h [system] {
// Experimental C++ standard library interfaces
module std_experimental [system] {
- module deque {
- header "experimental/deque"
- export *
- }
- module forward_list {
- header "experimental/forward_list"
- export *
- }
module iterator {
header "experimental/iterator"
export *
}
- module list {
- header "experimental/list"
- export *
- }
- module map {
- header "experimental/map"
- export *
- }
module memory {
header "experimental/memory"
export *
}
- module memory_resource {
- header "experimental/memory_resource"
- export *
- }
module propagate_const {
header "experimental/propagate_const"
export *
}
- module regex {
- @requires_LIBCXX_ENABLE_LOCALIZATION@
- header "experimental/regex"
- export *
- }
module simd {
module abi_tag { private header "experimental/__simd/abi_tag.h" }
module aligned_tag { private header "experimental/__simd/aligned_tag.h" }
@@ -570,34 +545,14 @@ module std_experimental [system] {
header "experimental/simd"
export *
}
- module set {
- header "experimental/set"
- export *
- }
- module string {
- header "experimental/string"
- export *
- }
module type_traits {
header "experimental/type_traits"
export *
}
- module unordered_map {
- header "experimental/unordered_map"
- export *
- }
- module unordered_set {
- header "experimental/unordered_set"
- export *
- }
module utility {
header "experimental/utility"
export *
}
- module vector {
- header "experimental/vector"
- export *
- }
module __config {
textual header "experimental/__config"
export *
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 156dbe8a4c2f92e..be0113e6b0a585f 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -323,7 +323,7 @@ endif()
add_custom_target(cxx DEPENDS ${LIBCXX_BUILD_TARGETS})
set(LIBCXX_EXPERIMENTAL_SOURCES
- experimental/memory_resource.cpp
+ experimental/keep.cpp
)
if (LIBCXX_PSTL_CPU_BACKEND STREQUAL "libdispatch")
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.overview/nothing_to_do.pass.cpp b/libcxx/src/experimental/keep.cpp
similarity index 76%
rename from libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.overview/nothing_to_do.pass.cpp
rename to libcxx/src/experimental/keep.cpp
index 796f3c353ba17d4..f3db69d798dd521 100644
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.overview/nothing_to_do.pass.cpp
+++ b/libcxx/src/experimental/keep.cpp
@@ -6,6 +6,5 @@
//
//===----------------------------------------------------------------------===//
-int main(int, char**) {
- return 0;
-}
+// Empty file just to make sure we produce a libc++experimental.a library even
+// when there isn't anything in it.
diff --git a/libcxx/src/experimental/memory_resource.cpp b/libcxx/src/experimental/memory_resource.cpp
deleted file mode 100644
index 0798d2e72ceda06..000000000000000
--- a/libcxx/src/experimental/memory_resource.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include <experimental/memory_resource>
-
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-
-#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
-# include <atomic>
-#elif !defined(_LIBCPP_HAS_NO_THREADS)
-# include <mutex>
-# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
-# pragma comment(lib, "pthread")
-# endif
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-// memory_resource
-
-//memory_resource::~memory_resource() {}
-
-// new_delete_resource()
-
-class _LIBCPP_EXPORTED_FROM_ABI __new_delete_memory_resource_imp
- : public memory_resource
-{
- void *do_allocate(size_t size, size_t align) override {
-#ifdef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
- if (__is_overaligned_for_new(align))
- __throw_bad_alloc();
-#endif
- return _VSTD::__libcpp_allocate(size, align);
- }
-
- void do_deallocate(void *p, size_t n, size_t align) override {
- _VSTD::__libcpp_deallocate(p, n, align);
- }
-
- bool do_is_equal(memory_resource const & other) const noexcept override
- { return &other == this; }
-
-public:
- ~__new_delete_memory_resource_imp() override = default;
-};
-
-// null_memory_resource()
-
-class _LIBCPP_EXPORTED_FROM_ABI __null_memory_resource_imp
- : public memory_resource
-{
-public:
- ~__null_memory_resource_imp() = default;
-
-protected:
- virtual void* do_allocate(size_t, size_t) {
- __throw_bad_alloc();
- }
- virtual void do_deallocate(void *, size_t, size_t) {}
- virtual bool do_is_equal(memory_resource const & __other) const noexcept
- { return &__other == this; }
-};
-
-namespace {
-
-union ResourceInitHelper {
- struct {
- __new_delete_memory_resource_imp new_delete_res;
- __null_memory_resource_imp null_res;
- } resources;
- char dummy;
- constexpr ResourceInitHelper() : resources() {}
- ~ResourceInitHelper() {}
-};
-
-// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority
-// attribute with a value that's reserved for the implementation (we're the implementation).
-#include "memory_resource_init_helper.h"
-
-} // end namespace
-
-
-memory_resource * new_delete_resource() noexcept {
- return &res_init.resources.new_delete_res;
-}
-
-memory_resource * null_memory_resource() noexcept {
- return &res_init.resources.null_res;
-}
-
-// default_memory_resource()
-
-static memory_resource *
-__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) noexcept
-{
-#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
- static constinit atomic<memory_resource*> __res{&res_init.resources.new_delete_res};
- if (set) {
- new_res = new_res ? new_res : new_delete_resource();
- // TODO: Can a weaker ordering be used?
- return _VSTD::atomic_exchange_explicit(
- &__res, new_res, memory_order_acq_rel);
- }
- else {
- return _VSTD::atomic_load_explicit(
- &__res, memory_order_acquire);
- }
-#elif !defined(_LIBCPP_HAS_NO_THREADS)
- static constinit memory_resource *res = &res_init.resources.new_delete_res;
- static mutex res_lock;
- if (set) {
- new_res = new_res ? new_res : new_delete_resource();
- lock_guard<mutex> guard(res_lock);
- memory_resource * old_res = res;
- res = new_res;
- return old_res;
- } else {
- lock_guard<mutex> guard(res_lock);
- return res;
- }
-#else
- static constinit memory_resource *res = &res_init.resources.new_delete_res;
- if (set) {
- new_res = new_res ? new_res : new_delete_resource();
- memory_resource * old_res = res;
- res = new_res;
- return old_res;
- } else {
- return res;
- }
-#endif
-}
-
-memory_resource * get_default_resource() noexcept
-{
- return __default_memory_resource();
-}
-
-memory_resource * set_default_resource(memory_resource * __new_res) noexcept
-{
- return __default_memory_resource(true, __new_res);
-}
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
diff --git a/libcxx/src/experimental/memory_resource_init_helper.h b/libcxx/src/experimental/memory_resource_init_helper.h
deleted file mode 100644
index 032edc12fa2783c..000000000000000
--- a/libcxx/src/experimental/memory_resource_init_helper.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma GCC system_header
-static constinit ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX;
diff --git a/libcxx/test/libcxx/experimental/lit.local.cfg b/libcxx/test/libcxx/experimental/lit.local.cfg
deleted file mode 100644
index ebfaa02f5521872..000000000000000
--- a/libcxx/test/libcxx/experimental/lit.local.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# Disable all of the experimental tests if the correct feature is not available.
-if "c++experimental" not in config.available_features:
- config.unsupported = True
diff --git a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
deleted file mode 100644
index 135f5e5f297f792..000000000000000
--- a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// T* polymorphic_allocator<T>::deallocate(T*, size_t size)
-
-// REQUIRES: has-unix-headers
-// UNSUPPORTED: c++03
-// REQUIRES: libcpp-hardening-mode={{extensive|debug}}
-// XFAIL: availability-verbose_abort-missing
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "check_assertion.h"
-#include "test_memory_resource.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**) {
- using Alloc = ex::polymorphic_allocator<int>;
- using Traits = std::allocator_traits<Alloc>;
- NullResource R;
- Alloc a(&R);
- const std::size_t maxSize = Traits::max_size(a);
-
- a.deallocate(nullptr, maxSize); // no assertion
- TEST_LIBCPP_ASSERT_FAILURE(a.deallocate(nullptr, maxSize + 1), "deallocate called for size which exceeds max_size()");
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
deleted file mode 100644
index be9909c91d77b92..000000000000000
--- a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class U1, class U2, class ...Args1, class ...Args2>
-// void polymorphic_allocator<T>::construct(pair<T1, T2>*, piecewise_construct_t
-// tuple<Args1...> x, tuple<Args2...>)
-
-// The standard specifies a transformation to uses-allocator construction as
-// follows:
-// - If uses_allocator_v<T1,memory_resource*> is false and
-// is_constructible_v<T,Args1...> is true, then xprime is x.
-// - Otherwise, if uses_allocator_v<T1,memory_resource*> is true and
-// is_constructible_v<T1,allocator_arg_t,memory_resource*,Args1...> is true,
-// then xprime is
-// tuple_cat(make_tuple(allocator_arg, this->resource()), std::move(x)).
-// - Otherwise, if uses_allocator_v<T1,memory_resource*> is true and
-// is_constructible_v<T1,Args1...,memory_resource*> is true, then xprime is
-// tuple_cat(std::move(x), make_tuple(this->resource())).
-// - Otherwise the program is ill formed.
-//
-// The use of "xprime = tuple_cat(..., std::move(x), ...)" causes all of the
-// objects in 'x' to be copied into 'xprime'. If 'x' contains any types which
-// are stored by value this causes an unnecessary copy to occur. To prevent this
-// libc++ changes this call into
-// "xprime = forward_as_tuple(..., std::get<Idx>(std::move(x))..., ...)".
-// 'xprime' contains references to the values in 'x' instead of copying them.
-
-// This test checks the number of copies incurred to the elements in
-// 'tuple<Args1...>' and 'tuple<Args2...>'.
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <utility>
-#include <tuple>
-#include <cassert>
-#include <cstdlib>
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-template <class T>
-struct TestHarness {
- TestResource R;
- ex::memory_resource * M = &R;
- ex::polymorphic_allocator<T> A = M;
- bool constructed = false;
- T * ptr;
-
- TestHarness() : ptr(A.allocate(1)) {}
-
- template <class ...Args>
- void construct(Args&&... args) {
- A.construct(ptr, std::forward<Args>(args)...);
- constructed = true;
- }
-
- ~TestHarness() {
- if (constructed) A.destroy(ptr);
- A.deallocate(ptr, 1);
- }
-};
-
-struct CountCopies {
- int count;
- CountCopies() : count(0) {}
- CountCopies(CountCopies const& o) : count(o.count + 1) {}
-};
-
-struct CountCopiesAllocV1 {
- typedef ex::polymorphic_allocator<char> allocator_type;
- ex::memory_resource *alloc;
- int count;
- CountCopiesAllocV1() : alloc(nullptr), count(0) {}
- CountCopiesAllocV1(std::allocator_arg_t, allocator_type const& a,
- CountCopiesAllocV1 const& o) : alloc(a.resource()), count(o.count + 1)
- {}
-
- CountCopiesAllocV1(CountCopiesAllocV1 const& o) : count(o.count + 1) {}
-};
-
-
-struct CountCopiesAllocV2 {
- typedef ex::polymorphic_allocator<char> allocator_type;
- ex::memory_resource *alloc;
- int count;
- CountCopiesAllocV2() : alloc(nullptr), count(0) {}
- CountCopiesAllocV2(CountCopiesAllocV2 const& o, allocator_type const& a)
- : alloc(a.resource()), count(o.count + 1)
- { }
-
- CountCopiesAllocV2(CountCopiesAllocV2 const& o) : count(o.count + 1) {}
-};
-
-
-int main(int, char**)
-{
- {
- using T = CountCopies;
- using U = CountCopiesAllocV1;
- using P = std::pair<T, U>;
-
- std::tuple<T> t1;
- std::tuple<U> t2;
-
- TestHarness<P> h;
- h.construct(std::piecewise_construct, t1, t2);
- P const& p = *h.ptr;
- assert(p.first.count == 2);
- assert(p.second.count == 2);
- assert(p.second.alloc == h.M);
- }
- {
- using T = CountCopiesAllocV1;
- using U = CountCopiesAllocV2;
- using P = std::pair<T, U>;
-
- std::tuple<T> t1;
- std::tuple<U> t2;
-
- TestHarness<P> h;
- h.construct(std::piecewise_construct, std::move(t1), std::move(t2));
- P const& p = *h.ptr;
- assert(p.first.count == 2);
- assert(p.first.alloc == h.M);
- assert(p.second.count == 2);
- assert(p.second.alloc == h.M);
- }
- {
- using T = CountCopiesAllocV2;
- using U = CountCopiesAllocV1;
- using P = std::pair<T, U>;
-
- std::tuple<T> t1;
- std::tuple<U> t2;
-
- TestHarness<P> h;
- h.construct(std::piecewise_construct, std::move(t1), std::move(t2));
- P const& p = *h.ptr;
- assert(p.first.count == 2);
- assert(p.first.alloc == h.M);
- assert(p.second.count == 2);
- assert(p.second.alloc == h.M);
- }
- {
- using T = CountCopiesAllocV2;
- using U = CountCopies;
- using P = std::pair<T, U>;
-
- std::tuple<T> t1;
- std::tuple<U> t2;
-
- TestHarness<P> h;
- h.construct(std::piecewise_construct, t1, t2);
- P const& p = *h.ptr;
- assert(p.first.count == 2);
- assert(p.first.alloc == h.M);
- assert(p.second.count == 2);
- }
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
deleted file mode 100644
index caee61e6a9b053e..000000000000000
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// T* polymorphic_allocator<T>::deallocate(T*, size_t size)
-
-// REQUIRES: has-unix-headers
-// UNSUPPORTED: c++03
-// REQUIRES: libcpp-hardening-mode={{extensive|debug}}
-// XFAIL: availability-verbose_abort-missing
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "check_assertion.h"
-#include "test_memory_resource.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**) {
- using Alloc = NullAllocator<char>;
-
- AllocController P;
- ex::resource_adaptor<Alloc> r(Alloc{P});
- ex::memory_resource & m1 = r;
-
- std::size_t maxSize = std::numeric_limits<std::size_t>::max()
- - alignof(std::max_align_t);
-
- m1.deallocate(nullptr, maxSize); // no assertion
- TEST_LIBCPP_ASSERT_FAILURE(m1.deallocate(nullptr, maxSize + 1), "do_deallocate called for size which exceeds the maximum allocation size");
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
deleted file mode 100644
index 87ffb28a07c78da..000000000000000
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// memory_resource * new_delete_resource()
-
-// The lifetime of the value returned by 'new_delete_resource()' should
-// never end, even very late into program termination. This test constructs
-// attempts to use 'new_delete_resource()' very late in program termination
-// to detect lifetime issues.
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-struct POSType {
- ex::memory_resource* res = nullptr;
- void* ptr = nullptr;
- int n = 0;
- POSType() {}
- POSType(ex::memory_resource* r, void* p, int s) : res(r), ptr(p), n(s) {}
- ~POSType() {
- if (ptr) {
- if (!res) res = ex::get_default_resource();
- res->deallocate(ptr, n);
- }
- }
-};
-
-void swap(POSType & L, POSType & R) {
- std::swap(L.res, R.res);
- std::swap(L.ptr, R.ptr);
- std::swap(L.n, R.n);
-}
-
-POSType constructed_before_resources;
-POSType constructed_before_resources2;
-
-// Constructs resources
-ex::memory_resource* resource = ex::get_default_resource();
-
-POSType constructed_after_resources(resource, resource->allocate(1024), 1024);
-POSType constructed_after_resources2(nullptr, resource->allocate(1024), 1024);
-
-int main(int, char**)
-{
- swap(constructed_after_resources, constructed_before_resources);
- swap(constructed_before_resources2, constructed_after_resources2);
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
deleted file mode 100644
index bba56e7dc1dd5ff..000000000000000
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// memory_resource * new_delete_resource()
-
-// The lifetime of the value returned by 'new_delete_resource()' should
-// never end, even very late into program termination. This test constructs
-// attempts to use 'new_delete_resource()' very late in program termination
-// to detect lifetime issues.
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-struct POSType {
- ex::memory_resource* res = nullptr;
- void* ptr = nullptr;
- int n = 0;
- POSType() {res = ex::new_delete_resource(); ptr = res->allocate(42); n = 42; }
- POSType(ex::memory_resource* r, void* p, int s) : res(r), ptr(p), n(s) {}
- ~POSType() { if (ptr) res->deallocate(ptr, n); }
-};
-
-void swap(POSType & L, POSType & R) {
- std::swap(L.res, R.res);
- std::swap(L.ptr, R.ptr);
- std::swap(L.n, R.n);
-}
-
-POSType constructed_before_resources;
-
-// Constructs resources
-ex::memory_resource* resource = ex::new_delete_resource();
-
-POSType constructed_after_resources(resource, resource->allocate(1024), 1024);
-
-int main(int, char**)
-{
- swap(constructed_after_resources, constructed_before_resources);
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/transitive_includes/cxx03.csv b/libcxx/test/libcxx/transitive_includes/cxx03.csv
index 65eae36a4c6c6e6..7066de65a913722 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx03.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx03.csv
@@ -229,63 +229,20 @@ expected cstddef
expected initializer_list
expected new
expected version
-experimental/deque deque
-experimental/deque experimental/memory_resource
-experimental/forward_list experimental/memory_resource
-experimental/forward_list forward_list
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
experimental/iterator type_traits
-experimental/list experimental/memory_resource
-experimental/list list
-experimental/map experimental/memory_resource
-experimental/map map
experimental/memory cstddef
experimental/memory cstdint
experimental/memory cstring
experimental/memory limits
-experimental/memory_resource atomic
-experimental/memory_resource climits
-experimental/memory_resource concepts
-experimental/memory_resource cstddef
-experimental/memory_resource cstdlib
-experimental/memory_resource cstring
-experimental/memory_resource ctime
-experimental/memory_resource experimental/utility
-experimental/memory_resource iterator
-experimental/memory_resource limits
-experimental/memory_resource memory
-experimental/memory_resource new
-experimental/memory_resource ratio
-experimental/memory_resource stdexcept
-experimental/memory_resource tuple
-experimental/memory_resource type_traits
-experimental/memory_resource variant
experimental/propagate_const cstddef
experimental/propagate_const type_traits
-experimental/regex experimental/memory_resource
-experimental/regex experimental/string
-experimental/regex regex
-experimental/set experimental/memory_resource
-experimental/set set
experimental/simd cstddef
experimental/simd cstdint
experimental/simd limits
-experimental/string experimental/memory_resource
-experimental/string string
-experimental/unordered_map algorithm
-experimental/unordered_map array
-experimental/unordered_map bit
-experimental/unordered_map experimental/memory_resource
-experimental/unordered_map functional
-experimental/unordered_map unordered_map
-experimental/unordered_map vector
-experimental/unordered_set experimental/memory_resource
-experimental/unordered_set unordered_set
experimental/utility utility
-experimental/vector experimental/memory_resource
-experimental/vector vector
filesystem compare
filesystem concepts
filesystem cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx11.csv b/libcxx/test/libcxx/transitive_includes/cxx11.csv
index a6c574e1d4b64bd..c4dc664d6ca8176 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx11.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx11.csv
@@ -230,63 +230,20 @@ expected cstddef
expected initializer_list
expected new
expected version
-experimental/deque deque
-experimental/deque experimental/memory_resource
-experimental/forward_list experimental/memory_resource
-experimental/forward_list forward_list
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
experimental/iterator type_traits
-experimental/list experimental/memory_resource
-experimental/list list
-experimental/map experimental/memory_resource
-experimental/map map
experimental/memory cstddef
experimental/memory cstdint
experimental/memory cstring
experimental/memory limits
-experimental/memory_resource atomic
-experimental/memory_resource climits
-experimental/memory_resource concepts
-experimental/memory_resource cstddef
-experimental/memory_resource cstdlib
-experimental/memory_resource cstring
-experimental/memory_resource ctime
-experimental/memory_resource experimental/utility
-experimental/memory_resource iterator
-experimental/memory_resource limits
-experimental/memory_resource memory
-experimental/memory_resource new
-experimental/memory_resource ratio
-experimental/memory_resource stdexcept
-experimental/memory_resource tuple
-experimental/memory_resource type_traits
-experimental/memory_resource variant
experimental/propagate_const cstddef
experimental/propagate_const type_traits
-experimental/regex experimental/memory_resource
-experimental/regex experimental/string
-experimental/regex regex
-experimental/set experimental/memory_resource
-experimental/set set
experimental/simd cstddef
experimental/simd cstdint
experimental/simd limits
-experimental/string experimental/memory_resource
-experimental/string string
-experimental/unordered_map algorithm
-experimental/unordered_map array
-experimental/unordered_map bit
-experimental/unordered_map experimental/memory_resource
-experimental/unordered_map functional
-experimental/unordered_map unordered_map
-experimental/unordered_map vector
-experimental/unordered_set experimental/memory_resource
-experimental/unordered_set unordered_set
experimental/utility utility
-experimental/vector experimental/memory_resource
-experimental/vector vector
filesystem compare
filesystem concepts
filesystem cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx14.csv b/libcxx/test/libcxx/transitive_includes/cxx14.csv
index 9021c91ee2aed05..20ee43722d894bb 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx14.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx14.csv
@@ -230,65 +230,22 @@ expected cstddef
expected initializer_list
expected new
expected version
-experimental/deque deque
-experimental/deque experimental/memory_resource
-experimental/forward_list experimental/memory_resource
-experimental/forward_list forward_list
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
experimental/iterator type_traits
-experimental/list experimental/memory_resource
-experimental/list list
-experimental/map experimental/memory_resource
-experimental/map map
experimental/memory cstddef
experimental/memory cstdint
experimental/memory cstring
experimental/memory limits
-experimental/memory_resource atomic
-experimental/memory_resource climits
-experimental/memory_resource concepts
-experimental/memory_resource cstddef
-experimental/memory_resource cstdlib
-experimental/memory_resource cstring
-experimental/memory_resource ctime
-experimental/memory_resource experimental/utility
-experimental/memory_resource iterator
-experimental/memory_resource limits
-experimental/memory_resource memory
-experimental/memory_resource new
-experimental/memory_resource ratio
-experimental/memory_resource stdexcept
-experimental/memory_resource tuple
-experimental/memory_resource type_traits
-experimental/memory_resource variant
experimental/propagate_const cstddef
experimental/propagate_const type_traits
-experimental/regex experimental/memory_resource
-experimental/regex experimental/string
-experimental/regex regex
-experimental/set experimental/memory_resource
-experimental/set set
experimental/simd cstddef
experimental/simd cstdint
experimental/simd limits
-experimental/string experimental/memory_resource
-experimental/string string
experimental/type_traits initializer_list
experimental/type_traits type_traits
-experimental/unordered_map algorithm
-experimental/unordered_map array
-experimental/unordered_map bit
-experimental/unordered_map experimental/memory_resource
-experimental/unordered_map functional
-experimental/unordered_map unordered_map
-experimental/unordered_map vector
-experimental/unordered_set experimental/memory_resource
-experimental/unordered_set unordered_set
experimental/utility utility
-experimental/vector experimental/memory_resource
-experimental/vector vector
filesystem compare
filesystem concepts
filesystem cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx17.csv b/libcxx/test/libcxx/transitive_includes/cxx17.csv
index 9021c91ee2aed05..20ee43722d894bb 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx17.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx17.csv
@@ -230,65 +230,22 @@ expected cstddef
expected initializer_list
expected new
expected version
-experimental/deque deque
-experimental/deque experimental/memory_resource
-experimental/forward_list experimental/memory_resource
-experimental/forward_list forward_list
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
experimental/iterator type_traits
-experimental/list experimental/memory_resource
-experimental/list list
-experimental/map experimental/memory_resource
-experimental/map map
experimental/memory cstddef
experimental/memory cstdint
experimental/memory cstring
experimental/memory limits
-experimental/memory_resource atomic
-experimental/memory_resource climits
-experimental/memory_resource concepts
-experimental/memory_resource cstddef
-experimental/memory_resource cstdlib
-experimental/memory_resource cstring
-experimental/memory_resource ctime
-experimental/memory_resource experimental/utility
-experimental/memory_resource iterator
-experimental/memory_resource limits
-experimental/memory_resource memory
-experimental/memory_resource new
-experimental/memory_resource ratio
-experimental/memory_resource stdexcept
-experimental/memory_resource tuple
-experimental/memory_resource type_traits
-experimental/memory_resource variant
experimental/propagate_const cstddef
experimental/propagate_const type_traits
-experimental/regex experimental/memory_resource
-experimental/regex experimental/string
-experimental/regex regex
-experimental/set experimental/memory_resource
-experimental/set set
experimental/simd cstddef
experimental/simd cstdint
experimental/simd limits
-experimental/string experimental/memory_resource
-experimental/string string
experimental/type_traits initializer_list
experimental/type_traits type_traits
-experimental/unordered_map algorithm
-experimental/unordered_map array
-experimental/unordered_map bit
-experimental/unordered_map experimental/memory_resource
-experimental/unordered_map functional
-experimental/unordered_map unordered_map
-experimental/unordered_map vector
-experimental/unordered_set experimental/memory_resource
-experimental/unordered_set unordered_set
experimental/utility utility
-experimental/vector experimental/memory_resource
-experimental/vector vector
filesystem compare
filesystem concepts
filesystem cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx20.csv b/libcxx/test/libcxx/transitive_includes/cxx20.csv
index c047702b445994e..d256370aac4a4a9 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx20.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx20.csv
@@ -236,65 +236,22 @@ expected cstddef
expected initializer_list
expected new
expected version
-experimental/deque deque
-experimental/deque experimental/memory_resource
-experimental/forward_list experimental/memory_resource
-experimental/forward_list forward_list
experimental/iterator cstddef
experimental/iterator iosfwd
experimental/iterator iterator
experimental/iterator type_traits
-experimental/list experimental/memory_resource
-experimental/list list
-experimental/map experimental/memory_resource
-experimental/map map
experimental/memory cstddef
experimental/memory cstdint
experimental/memory cstring
experimental/memory limits
-experimental/memory_resource atomic
-experimental/memory_resource climits
-experimental/memory_resource concepts
-experimental/memory_resource cstddef
-experimental/memory_resource cstdlib
-experimental/memory_resource cstring
-experimental/memory_resource ctime
-experimental/memory_resource experimental/utility
-experimental/memory_resource iterator
-experimental/memory_resource limits
-experimental/memory_resource memory
-experimental/memory_resource new
-experimental/memory_resource ratio
-experimental/memory_resource stdexcept
-experimental/memory_resource tuple
-experimental/memory_resource type_traits
-experimental/memory_resource variant
experimental/propagate_const cstddef
experimental/propagate_const type_traits
-experimental/regex experimental/memory_resource
-experimental/regex experimental/string
-experimental/regex regex
-experimental/set experimental/memory_resource
-experimental/set set
experimental/simd cstddef
experimental/simd cstdint
experimental/simd limits
-experimental/string experimental/memory_resource
-experimental/string string
experimental/type_traits initializer_list
experimental/type_traits type_traits
-experimental/unordered_map algorithm
-experimental/unordered_map array
-experimental/unordered_map bit
-experimental/unordered_map experimental/memory_resource
-experimental/unordered_map functional
-experimental/unordered_map unordered_map
-experimental/unordered_map vector
-experimental/unordered_set experimental/memory_resource
-experimental/unordered_set unordered_set
experimental/utility utility
-experimental/vector experimental/memory_resource
-experimental/vector vector
filesystem compare
filesystem concepts
filesystem cstddef
diff --git a/libcxx/test/libcxx/transitive_includes/cxx23.csv b/libcxx/test/libcxx/transitive_includes/cxx23.csv
index a0ed2e290ffd92a..9edc283236480e4 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx23.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx23.csv
@@ -160,46 +160,19 @@ expected cstddef
expected initializer_list
expected new
expected version
-experimental/deque deque
-experimental/deque experimental/memory_resource
-experimental/forward_list experimental/memory_resource
-experimental/forward_list forward_list
experimental/iterator cstddef
experimental/iterator iterator
-experimental/list experimental/memory_resource
-experimental/list list
-experimental/map experimental/memory_resource
-experimental/map map
experimental/memory cstddef
experimental/memory cstdint
experimental/memory cstring
experimental/memory limits
-experimental/memory_resource cstddef
-experimental/memory_resource experimental/utility
-experimental/memory_resource limits
-experimental/memory_resource new
-experimental/memory_resource stdexcept
-experimental/memory_resource tuple
experimental/propagate_const cstddef
-experimental/regex experimental/memory_resource
-experimental/regex experimental/string
-experimental/regex regex
-experimental/set experimental/memory_resource
-experimental/set set
experimental/simd cstddef
experimental/simd cstdint
experimental/simd limits
-experimental/string experimental/memory_resource
-experimental/string string
experimental/type_traits initializer_list
experimental/type_traits type_traits
-experimental/unordered_map experimental/memory_resource
-experimental/unordered_map unordered_map
-experimental/unordered_set experimental/memory_resource
-experimental/unordered_set unordered_set
experimental/utility utility
-experimental/vector experimental/memory_resource
-experimental/vector vector
filesystem compare
filesystem cstddef
filesystem cstdint
diff --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index a0ed2e290ffd92a..9edc283236480e4 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -160,46 +160,19 @@ expected cstddef
expected initializer_list
expected new
expected version
-experimental/deque deque
-experimental/deque experimental/memory_resource
-experimental/forward_list experimental/memory_resource
-experimental/forward_list forward_list
experimental/iterator cstddef
experimental/iterator iterator
-experimental/list experimental/memory_resource
-experimental/list list
-experimental/map experimental/memory_resource
-experimental/map map
experimental/memory cstddef
experimental/memory cstdint
experimental/memory cstring
experimental/memory limits
-experimental/memory_resource cstddef
-experimental/memory_resource experimental/utility
-experimental/memory_resource limits
-experimental/memory_resource new
-experimental/memory_resource stdexcept
-experimental/memory_resource tuple
experimental/propagate_const cstddef
-experimental/regex experimental/memory_resource
-experimental/regex experimental/string
-experimental/regex regex
-experimental/set experimental/memory_resource
-experimental/set set
experimental/simd cstddef
experimental/simd cstdint
experimental/simd limits
-experimental/string experimental/memory_resource
-experimental/string string
experimental/type_traits initializer_list
experimental/type_traits type_traits
-experimental/unordered_map experimental/memory_resource
-experimental/unordered_map unordered_map
-experimental/unordered_set experimental/memory_resource
-experimental/unordered_set unordered_set
experimental/utility utility
-experimental/vector experimental/memory_resource
-experimental/vector vector
filesystem compare
filesystem cstddef
filesystem cstdint
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp
deleted file mode 100644
index e966632ef4efe70..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// polymorphic_allocator operator=(polymorphic_allocator const &) = delete
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<void> T;
- static_assert(!std::is_copy_assignable<T>::value, "");
- static_assert(!std::is_move_assignable<T>::value, "");
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/copy.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/copy.pass.cpp
deleted file mode 100644
index 4fb34b8e69c6ad9..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/copy.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// polymorphic_allocator<T>::polymorphic_allocator(polymorphic_allocator const &);
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<void> A1;
- {
- static_assert(
- std::is_copy_constructible<A1>::value, ""
- );
- static_assert(
- std::is_move_constructible<A1>::value, ""
- );
- }
- // copy
- {
- A1 const a((ex::memory_resource*)42);
- A1 const a2(a);
- assert(a.resource() == a2.resource());
- }
- // move
- {
- A1 a((ex::memory_resource*)42);
- A1 a2(std::move(a));
- assert(a.resource() == a2.resource());
- assert(a2.resource() == (ex::memory_resource*)42);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp
deleted file mode 100644
index 099c39bceea3eaf..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// polymorphic_allocator<T>::polymorphic_allocator() noexcept
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- {
- static_assert(
- std::is_nothrow_default_constructible<ex::polymorphic_allocator<void>>::value
- , "Must me nothrow default constructible"
- );
- }
- {
- // test that the allocator gets its resource from get_default_resource
- TestResource R1(42);
- ex::set_default_resource(&R1);
-
- typedef ex::polymorphic_allocator<void> A;
- A const a;
- assert(a.resource() == &R1);
-
- ex::set_default_resource(nullptr);
- A const a2;
- assert(a.resource() == &R1);
- assert(a2.resource() == ex::new_delete_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/memory_resource_convert.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/memory_resource_convert.pass.cpp
deleted file mode 100644
index e72b49615b49652..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/memory_resource_convert.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// polymorphic_allocator<T>::polymorphic_allocator(memory_resource *)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- {
- typedef ex::polymorphic_allocator<void> A;
- static_assert(
- std::is_convertible<decltype(nullptr), A>::value
- , "Must be convertible"
- );
- static_assert(
- std::is_convertible<ex::memory_resource *, A>::value
- , "Must be convertible"
- );
- }
- {
- typedef ex::polymorphic_allocator<void> A;
- TestResource R;
- A const a(&R);
- assert(a.resource() == &R);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/other_alloc.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/other_alloc.pass.cpp
deleted file mode 100644
index b56e479719602b9..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/other_alloc.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class U>
-// polymorphic_allocator<T>::polymorphic_allocator(polymorphic_allocator<U> const &);
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<void> A1;
- typedef ex::polymorphic_allocator<char> A2;
- { // Test that the conversion is implicit and noexcept.
- static_assert(
- std::is_convertible<A1 const &, A2>::value, ""
- );
- static_assert(
- std::is_convertible<A2 const &, A1>::value, ""
- );
- static_assert(
- std::is_nothrow_constructible<A1, A2 const &>::value, ""
- );
- static_assert(
- std::is_nothrow_constructible<A2, A1 const &>::value, ""
- );
- }
- // copy other type
- {
- A1 const a((ex::memory_resource*)42);
- A2 const a2(a);
- assert(a.resource() == a2.resource());
- assert(a2.resource() == (ex::memory_resource*)42);
- }
- {
- A1 a((ex::memory_resource*)42);
- A2 const a2(std::move(a));
- assert(a.resource() == a2.resource());
- assert(a2.resource() == (ex::memory_resource*)42);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp
deleted file mode 100644
index 475c4cee4fa5aa9..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator;
-
-// template <class T, class U>
-// bool operator==(
-// polymorphic_allocator<T> const &
-// , polymorphic_allocator<U> const &) noexcept
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<void> A1;
- typedef ex::polymorphic_allocator<int> A2;
- // check return types
- {
- A1 const a1;
- A2 const a2;
- static_assert(std::is_same<decltype(a1 == a2), bool>::value, "");
- static_assert(noexcept(a1 == a2), "");
- }
- // equal same type (
diff erent resource)
- {
- TestResource d1(1);
- TestResource d2(1);
- A1 const a1(&d1);
- A1 const a2(&d2);
-
- assert(a1 == a2);
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(0));
-
- d1.reset();
-
- assert(a2 == a1);
- assert(d1.checkIsEqualCalledEq(0));
- assert(d2.checkIsEqualCalledEq(1));
- }
- // equal same type (same resource)
- {
- TestResource d1;
- A1 const a1(&d1);
- A1 const a2(&d1);
-
- assert(a1 == a2);
- assert(d1.checkIsEqualCalledEq(0));
-
- assert(a2 == a1);
- assert(d1.checkIsEqualCalledEq(0));
- }
- // equal
diff erent type (
diff erent resource)
- {
- TestResource d1(42);
- TestResource d2(42);
- A1 const a1(&d1);
- A2 const a2(&d2);
-
- assert(a1 == a2);
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(0));
-
- assert(a2 == a1);
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(1));
-
- }
- // equal
diff erent type (same resource)
- {
- TestResource d1(42);
- A1 const a1(&d1);
- A2 const a2(&d1);
-
- assert(a1 == a2);
- assert(d1.checkIsEqualCalledEq(0));
-
- assert(a2 == a1);
- assert(d1.checkIsEqualCalledEq(0));
-
- }
- // not equal same type
- {
- TestResource d1(1);
- TestResource d2(2);
- A1 const a1(&d1);
- A1 const a2(&d2);
-
- assert(!(a1 == a2));
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(0));
-
- d1.reset();
-
- assert(!(a2 == a1));
- assert(d1.checkIsEqualCalledEq(0));
- assert(d2.checkIsEqualCalledEq(1));
-
- }
- // not equal
diff erent types
- {
- TestResource d1;
- TestResource1 d2;
- A1 const a1(&d1);
- A2 const a2(&d2);
-
- assert(!(a1 == a2));
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(0));
-
- d1.reset();
-
- assert(!(a2 == a1));
- assert(d1.checkIsEqualCalledEq(0));
- assert(d2.checkIsEqualCalledEq(1));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp
deleted file mode 100644
index 3376459b311e08e..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator;
-
-// template <class T>
-// bool operator!=(
-// polymorphic_allocator<T> const &
-// , polymorphic_allocator<T> const &) noexcept
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<void> A1;
- typedef ex::polymorphic_allocator<int> A2;
- // check return types
- {
- A1 const a1;
- A2 const a2;
- static_assert(std::is_same<decltype(a1 != a2), bool>::value, "");
- static_assert(noexcept(a1 != a2), "");
- }
- // not equal same type (
diff erent resource)
- {
- TestResource d1(1);
- TestResource d2(2);
- A1 const a1(&d1);
- A1 const a2(&d2);
-
- assert(a1 != a2);
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(0));
-
- d1.reset();
-
- assert(a2 != a1);
- assert(d1.checkIsEqualCalledEq(0));
- assert(d2.checkIsEqualCalledEq(1));
- }
- // equal same type (same resource)
- {
- TestResource d1;
- A1 const a1(&d1);
- A1 const a2(&d1);
-
- assert(!(a1 != a2));
- assert(d1.checkIsEqualCalledEq(0));
-
- assert(!(a2 != a1));
- assert(d1.checkIsEqualCalledEq(0));
- }
- // equal same type
- {
- TestResource d1(1);
- TestResource d2(1);
- A1 const a1(&d1);
- A1 const a2(&d2);
-
- assert(!(a1 != a2));
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(0));
-
- d1.reset();
-
- assert(!(a2 != a1));
- assert(d1.checkIsEqualCalledEq(0));
- assert(d2.checkIsEqualCalledEq(1));
-
- }
- // not equal
diff erent types
- {
- TestResource d1;
- TestResource1 d2;
- A1 const a1(&d1);
- A2 const a2(&d2);
-
- assert(a1 != a2);
- assert(d1.checkIsEqualCalledEq(1));
- assert(d2.checkIsEqualCalledEq(0));
-
- d1.reset();
-
- assert(a2 != a1);
- assert(d1.checkIsEqualCalledEq(0));
- assert(d2.checkIsEqualCalledEq(1));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
deleted file mode 100644
index b2dc33737f1a8af..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// T* polymorphic_allocator<T>::allocate(size_t n)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <limits>
-#include <memory>
-#include <exception>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-
-namespace ex = std::experimental::pmr;
-
-template <std::size_t S, size_t Align>
-void testForSizeAndAlign() {
- struct T { alignas(Align) char data[S]; };
- TestResource R;
- ex::polymorphic_allocator<T> a(&R);
-
- for (int N = 1; N <= 5; ++N) {
- auto ret = a.allocate(N);
- assert(R.checkAlloc(ret, N * sizeof(T), alignof(T)));
-
- a.deallocate(ret, N);
- R.reset();
- }
-}
-
-#ifndef TEST_HAS_NO_EXCEPTIONS
-template <std::size_t S>
-void testAllocForSizeThrows() {
- struct T { char data[S]; };
- using Alloc = ex::polymorphic_allocator<T>;
- using Traits = std::allocator_traits<Alloc>;
- NullResource R;
- Alloc a(&R);
-
- // Test that allocating exactly the max size does not throw.
- std::size_t maxSize = Traits::max_size(a);
- try {
- a.allocate(maxSize);
- } catch (...) {
- assert(false);
- }
-
- std::size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
- if (maxSize != sizeTypeMax)
- {
- // Test that allocating size_t(~0) throws bad_array_new_length.
- try {
- a.allocate(sizeTypeMax);
- assert(false);
- } catch (std::bad_array_new_length const&) {
- }
-
- // Test that allocating even one more than the max size does throw.
- std::size_t overSize = maxSize + 1;
- try {
- a.allocate(overSize);
- assert(false);
- } catch (std::bad_array_new_length const&) {
- }
- }
-}
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-int main(int, char**)
-{
- {
- ex::polymorphic_allocator<int> a;
- static_assert(std::is_same<decltype(a.allocate(0)), int*>::value, "");
- static_assert(!noexcept(a.allocate(0)), "");
- }
- {
- constexpr std::size_t MA = alignof(std::max_align_t);
- testForSizeAndAlign<1, 1>();
- testForSizeAndAlign<1, 2>();
- testForSizeAndAlign<1, MA>();
- testForSizeAndAlign<2, 2>();
- testForSizeAndAlign<73, alignof(void*)>();
- testForSizeAndAlign<73, MA>();
- testForSizeAndAlign<13, MA>();
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- testAllocForSizeThrows<1>();
- testAllocForSizeThrows<2>();
- testAllocForSizeThrows<4>();
- testAllocForSizeThrows<8>();
- testAllocForSizeThrows<16>();
- testAllocForSizeThrows<73>();
- testAllocForSizeThrows<13>();
- }
-#endif
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
deleted file mode 100644
index 4899587274923fe..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class U1, class U2>
-// void polymorphic_allocator<T>::construct(pair<U1, U2>*)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <utility>
-#include <tuple>
-#include <cassert>
-#include <cstdlib>
-#include "uses_alloc_types.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int constructed = 0;
-
-struct default_constructible
-{
- default_constructible() : x(42) { ++constructed; }
- int x{0};
-};
-
-int main(int, char**)
-{
- // pair<default_constructible, default_constructible> as T()
- {
- typedef default_constructible T;
- typedef std::pair<T, T> P;
- typedef ex::polymorphic_allocator<void> A;
- P * ptr = (P*)std::malloc(sizeof(P));
- A a;
- a.construct(ptr);
- assert(constructed == 2);
- assert(ptr->first.x == 42);
- assert(ptr->second.x == 42);
- std::free(ptr);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
deleted file mode 100644
index 96a13b481460beb..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class P1, class P2, class U1, class U2>
-// void polymorphic_allocator<T>::construct(pair<P1, P2>*, pair<U1, U2> const&)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <utility>
-#include <tuple>
-#include <cassert>
-#include <cstdlib>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-#include "uses_alloc_types.h"
-#include "controlled_allocators.h"
-#include "test_allocator.h"
-
-namespace ex = std::experimental::pmr;
-
-
-template <class UA1, class UA2, class TT, class UU>
-bool doTest(UsesAllocatorType TExpect, UsesAllocatorType UExpect,
- std::pair<TT, UU> const& p)
-{
- using P = std::pair<UA1, UA2>;
- TestResource R;
- ex::memory_resource * M = &R;
- ex::polymorphic_allocator<P> A(M);
- P * ptr = (P*)std::malloc(sizeof(P));
- P * ptr2 = (P*)std::malloc(sizeof(P));
-
- // UNDER TEST //
- A.construct(ptr, p);
-
- A.construct(ptr2, std::piecewise_construct,
- std::forward_as_tuple(p.first),
- std::forward_as_tuple(p.second));
- // ------- //
-
- bool tres = checkConstruct<decltype((p.first))>(ptr->first, TExpect, M) &&
- checkConstructionEquiv(ptr->first, ptr2->first);
-
- bool ures = checkConstruct<decltype((p.second))>(ptr->second, UExpect, M) &&
- checkConstructionEquiv(ptr->second, ptr2->second);
-
- A.destroy(ptr);
- std::free(ptr);
- A.destroy(ptr2);
- std::free(ptr2);
- return tres && ures;
-
-}
-
-template <class Alloc, class TT, class UU>
-void test_pmr_uses_allocator(std::pair<TT, UU> const& p)
-{
- {
- using T = NotUsesAllocator<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, p)));
- }
- {
- using T = UsesAllocatorV1<Alloc, 1>;
- using U = UsesAllocatorV2<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocArg, UA_AllocLast, p)));
- }
- {
- using T = UsesAllocatorV2<Alloc, 1>;
- using U = UsesAllocatorV3<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocLast, UA_AllocArg, p)));
- }
- {
- using T = UsesAllocatorV3<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocArg, UA_None, p)));
- }
-}
-
-template <class Alloc, class TT, class UU>
-void test_pmr_not_uses_allocator(std::pair<TT, UU> const& p)
-{
- {
- using T = NotUsesAllocator<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, p)));
- }
- {
- using T = UsesAllocatorV1<Alloc, 1>;
- using U = UsesAllocatorV2<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, p)));
- }
- {
- using T = UsesAllocatorV2<Alloc, 1>;
- using U = UsesAllocatorV3<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, p)));
- }
- {
- using T = UsesAllocatorV3<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, p)));
- }
-}
-
-template <class Tp>
-struct Print;
-
-int main(int, char**)
-{
- using ERT = std::experimental::erased_type;
- using PMR = ex::memory_resource*;
- using PMA = ex::polymorphic_allocator<char>;
- {
- int x = 42;
- int y = 42;
- const std::pair<int, int&> p(x, y);
- test_pmr_uses_allocator<ERT>(p);
- test_pmr_not_uses_allocator<PMR>(p);
- test_pmr_uses_allocator<PMA>(p);
- }
- {
- int x = 42;
- int y = 42;
- const std::pair<int&, int&&> p(x, std::move(y));
- test_pmr_uses_allocator<ERT>(p);
- test_pmr_not_uses_allocator<PMR>(p);
- test_pmr_uses_allocator<PMA>(p);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
deleted file mode 100644
index c7be5efe9143561..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class P1, class P2, class U1, class U2>
-// void polymorphic_allocator<T>::construct(pair<P1, P2>*, pair<U1, U2> &&)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <utility>
-#include <tuple>
-#include <cassert>
-#include <cstdlib>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-#include "uses_alloc_types.h"
-#include "controlled_allocators.h"
-#include "test_allocator.h"
-
-namespace ex = std::experimental::pmr;
-
-
-
-template <class UA1, class UA2, class TT, class UU>
-bool doTest(UsesAllocatorType TExpect, UsesAllocatorType UExpect,
- std::pair<TT, UU>&& p)
-{
- using P = std::pair<UA1, UA2>;
- TestResource R;
- ex::memory_resource * M = &R;
- ex::polymorphic_allocator<P> A(M);
- P * ptr = A.allocate(2);
- P * ptr2 = ptr + 1;
-
- // UNDER TEST //
- A.construct(ptr, std::move(p));
-
- A.construct(ptr2, std::piecewise_construct,
- std::forward_as_tuple(std::forward<TT>(p.first)),
- std::forward_as_tuple(std::forward<UU>(p.second)));
- // ------- //
-
- bool tres = checkConstruct<TT&&>(ptr->first, TExpect, M) &&
- checkConstructionEquiv(ptr->first, ptr2->first);
-
- bool ures = checkConstruct<UU&&>(ptr->second, UExpect, M) &&
- checkConstructionEquiv(ptr->second, ptr2->second);
-
- A.destroy(ptr);
- A.destroy(ptr2);
- A.deallocate(ptr, 2);
- return tres && ures;
-}
-
-template <class Alloc, class TT, class UU>
-void test_pmr_uses_allocator(std::pair<TT, UU>&& p)
-{
- {
- using T = NotUsesAllocator<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
- }
- {
- using T = UsesAllocatorV1<Alloc, 1>;
- using U = UsesAllocatorV2<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocArg, UA_AllocLast, std::move(p))));
- }
- {
- using T = UsesAllocatorV2<Alloc, 1>;
- using U = UsesAllocatorV3<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocLast, UA_AllocArg, std::move(p))));
- }
- {
- using T = UsesAllocatorV3<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocArg, UA_None, std::move(p))));
- }
-}
-
-template <class Alloc, class TT, class UU>
-void test_pmr_not_uses_allocator(std::pair<TT, UU>&& p)
-{
- {
- using T = NotUsesAllocator<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
- }
- {
- using T = UsesAllocatorV1<Alloc, 1>;
- using U = UsesAllocatorV2<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
- }
- {
- using T = UsesAllocatorV2<Alloc, 1>;
- using U = UsesAllocatorV3<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
- }
- {
- using T = UsesAllocatorV3<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None, std::move(p))));
- }
-}
-
-int main(int, char**)
-{
- using ERT = std::experimental::erased_type;
- using PMR = ex::memory_resource*;
- using PMA = ex::polymorphic_allocator<char>;
- {
- int x = 42;
- int y = 42;
- std::pair<int&, int&&> p(x, std::move(y));
- test_pmr_uses_allocator<ERT>(std::move(p));
- test_pmr_not_uses_allocator<PMR>(std::move(p));
- test_pmr_uses_allocator<PMA>(std::move(p));
- }
- {
- int x = 42;
- int y = 42;
- std::pair<int&&, int&> p(std::move(x), y);
- test_pmr_uses_allocator<ERT>(std::move(p));
- test_pmr_not_uses_allocator<PMR>(std::move(p));
- test_pmr_uses_allocator<PMA>(std::move(p));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
deleted file mode 100644
index 03e466e3821a09e..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class P1, class P2, class U1, class U2>
-// void polymorphic_allocator<T>::construct(pair<P1, P2>*, U1&&, U2&&)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <utility>
-#include <tuple>
-#include <cassert>
-#include <cstdlib>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-#include "uses_alloc_types.h"
-#include "controlled_allocators.h"
-#include "test_allocator.h"
-
-namespace ex = std::experimental::pmr;
-
-
-template <class UA1, class UA2, class TT, class UU>
-bool doTest(UsesAllocatorType TExpect, UsesAllocatorType UExpect,
- TT&& t, UU&& u)
-{
- using P = std::pair<UA1, UA2>;
- TestResource R;
- ex::memory_resource * M = &R;
- ex::polymorphic_allocator<P> A(M);
- P * ptr = (P*)std::malloc(sizeof(P));
- P * ptr2 = (P*)std::malloc(sizeof(P));
-
- // UNDER TEST //
- A.construct(ptr, std::forward<TT>(t), std::forward<UU>(u));
- A.construct(ptr2, std::piecewise_construct,
- std::forward_as_tuple(std::forward<TT>(t)),
- std::forward_as_tuple(std::forward<UU>(u)));
- // ------- //
-
- bool tres = checkConstruct<TT&&>(ptr->first, TExpect, M) &&
- checkConstructionEquiv(ptr->first, ptr2->first);
-
- bool ures = checkConstruct<UU&&>(ptr->second, UExpect, M) &&
- checkConstructionEquiv(ptr->second, ptr2->second);
-
- A.destroy(ptr);
- A.destroy(ptr2);
- std::free(ptr);
- std::free(ptr2);
- return tres && ures;
-}
-
-template <class Alloc, class TT, class UU>
-void test_pmr_uses_allocator(TT&& t, UU&& u)
-{
- {
- using T = NotUsesAllocator<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
- {
- using T = UsesAllocatorV1<Alloc, 1>;
- using U = UsesAllocatorV2<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocArg, UA_AllocLast,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
- {
- using T = UsesAllocatorV2<Alloc, 1>;
- using U = UsesAllocatorV3<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocLast, UA_AllocArg,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
- {
- using T = UsesAllocatorV3<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_AllocArg, UA_None,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
-}
-
-template <class Alloc, class TT, class UU>
-void test_pmr_not_uses_allocator(TT&& t, UU&& u)
-{
- {
- using T = NotUsesAllocator<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
- {
- using T = UsesAllocatorV1<Alloc, 1>;
- using U = UsesAllocatorV2<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
- {
- using T = UsesAllocatorV2<Alloc, 1>;
- using U = UsesAllocatorV3<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
- {
- using T = UsesAllocatorV3<Alloc, 1>;
- using U = NotUsesAllocator<Alloc, 1>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::forward<TT>(t), std::forward<UU>(u))));
- }
-}
-
-int main(int, char**)
-{
- using ERT = std::experimental::erased_type;
- using PMR = ex::memory_resource*;
- using PMA = ex::polymorphic_allocator<char>;
- {
- int x = 42;
- int y = 42;
- test_pmr_uses_allocator<ERT>(x, std::move(y));
- test_pmr_not_uses_allocator<PMR>(x, std::move(y));
- test_pmr_uses_allocator<PMA>(x, std::move(y));
- }
- {
- int x = 42;
- const int y = 42;
- test_pmr_uses_allocator<ERT>(std::move(x), y);
- test_pmr_not_uses_allocator<PMR>(std::move(x), y);
- test_pmr_uses_allocator<PMA>(std::move(x), y);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
deleted file mode 100644
index 7e3f92bed4421fa..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class U1, class U2, class ...Args1, class ...Args2>
-// void polymorphic_allocator<T>::construct(pair<U1, U2>*, piecewise_construct_t
-// tuple<Args1...>, tuple<Args2...>)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <utility>
-#include <tuple>
-#include <cassert>
-#include <cstdlib>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-#include "uses_alloc_types.h"
-#include "controlled_allocators.h"
-#include "test_allocator.h"
-
-namespace ex = std::experimental::pmr;
-
-template <class T, class U, class ...TTuple, class ...UTuple>
-bool doTest(UsesAllocatorType TExpect, UsesAllocatorType UExpect,
- std::tuple<TTuple...> ttuple, std::tuple<UTuple...> utuple)
-{
- using P = std::pair<T, U>;
- TestResource R;
- ex::memory_resource * M = &R;
- ex::polymorphic_allocator<P> A(M);
- P * ptr = A.allocate(1);
-
- // UNDER TEST //
- A.construct(ptr, std::piecewise_construct, std::move(ttuple), std::move(utuple));
- // ------- //
- bool tres = checkConstruct<TTuple&&...>(ptr->first, TExpect, M);
- bool ures = checkConstruct<UTuple&&...>(ptr->second, UExpect, M);
-
- A.destroy(ptr);
- A.deallocate(ptr, 1);
- return tres && ures;
-}
-
-template <class Alloc, class ...TTypes, class ...UTypes>
-void test_pmr_uses_allocator(std::tuple<TTypes...> ttuple, std::tuple<UTypes...> utuple)
-{
- {
- using T = NotUsesAllocator<Alloc, sizeof...(TTypes)>;
- using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::move(ttuple), std::move(utuple))));
- }
- {
- using T = UsesAllocatorV1<Alloc, sizeof...(TTypes)>;
- using U = UsesAllocatorV2<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_AllocArg, UA_AllocLast,
- std::move(ttuple), std::move(utuple))));
- }
- {
- using T = UsesAllocatorV2<Alloc, sizeof...(TTypes)>;
- using U = UsesAllocatorV3<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_AllocLast, UA_AllocArg,
- std::move(ttuple), std::move(utuple))));
- }
- {
- using T = UsesAllocatorV3<Alloc, sizeof...(TTypes)>;
- using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_AllocArg, UA_None,
- std::move(ttuple), std::move(utuple))));
- }
-}
-
-template <class Alloc, class ...TTypes, class ...UTypes>
-void test_pmr_not_uses_allocator(std::tuple<TTypes...> ttuple, std::tuple<UTypes...> utuple)
-{
- {
- using T = NotUsesAllocator<Alloc, sizeof...(TTypes)>;
- using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::move(ttuple), std::move(utuple))));
- }
- {
- using T = UsesAllocatorV1<Alloc, sizeof...(TTypes)>;
- using U = UsesAllocatorV2<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::move(ttuple), std::move(utuple))));
- }
- {
- using T = UsesAllocatorV2<Alloc, sizeof...(TTypes)>;
- using U = UsesAllocatorV3<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::move(ttuple), std::move(utuple))));
- }
- {
- using T = UsesAllocatorV3<Alloc, sizeof...(TTypes)>;
- using U = NotUsesAllocator<Alloc, sizeof...(UTypes)>;
- assert((doTest<T, U>(UA_None, UA_None,
- std::move(ttuple), std::move(utuple))));
- }
-}
-
-int main(int, char**)
-{
- using ERT = std::experimental::erased_type;
- using PMR = ex::memory_resource*;
- using PMA = ex::polymorphic_allocator<char>;
- {
- std::tuple<> t1;
- test_pmr_uses_allocator<ERT>(t1, t1);
- test_pmr_not_uses_allocator<PMR>(t1, t1);
- test_pmr_uses_allocator<PMA>(t1, t1);
- }
- {
- std::tuple<int> t1(42);
- std::tuple<> t2;
- test_pmr_uses_allocator<ERT>(t1, t2);
- test_pmr_uses_allocator<ERT>(t2, t1);
- test_pmr_not_uses_allocator<PMR>(t1, t2);
- test_pmr_not_uses_allocator<PMR>(t2, t1);
- test_pmr_uses_allocator<PMA>(t1, t2);
- test_pmr_uses_allocator<PMA>(t2, t1);
- }
- {
- std::tuple<int> t1(42);
- int x = 55;
- double dx = 42.42;
- std::tuple<int&, double&&> t2(x, std::move(dx));
- test_pmr_uses_allocator<ERT>( t1, std::move(t2));
- test_pmr_uses_allocator<ERT>(std::move(t2), t1);
- test_pmr_not_uses_allocator<PMR>( t1, std::move(t2));
- test_pmr_not_uses_allocator<PMR>(std::move(t2), t1);
- test_pmr_uses_allocator<PMA>( t1, std::move(t2));
- test_pmr_uses_allocator<PMA>(std::move(t2), t1);
- }
- {
- void* xptr = nullptr;
- long y = 4242;
- std::tuple<int, long const&, void*&> t1(42, y, xptr);
- int x = 55;
- double dx = 42.42;
- const char* s = "hello World";
- std::tuple<int&, double&&, const char*> t2(x, std::move(dx), s);
- test_pmr_uses_allocator<ERT>( t1, std::move(t2));
- test_pmr_uses_allocator<ERT>(std::move(t2), t1);
- test_pmr_not_uses_allocator<PMR>( t1, std::move(t2));
- test_pmr_not_uses_allocator<PMR>(std::move(t2), t1);
- test_pmr_uses_allocator<PMA>( t1, std::move(t2));
- test_pmr_uses_allocator<PMA>(std::move(t2), t1);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
deleted file mode 100644
index 7b8ce2ccd451ecb..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class U1, class U2, class ...Args1, class ...Args2>
-// void polymorphic_allocator<T>::construct(pair<U1, U2>*, piecewise_construct_t
-// tuple<Args1...>, tuple<Args2...>)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <tuple>
-#include <type_traits>
-#include <utility>
-#include <cassert>
-#include <cstdlib>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-template <class T>
-struct EvilAlloc {
- explicit EvilAlloc() : inner_(ex::null_memory_resource()) {}
-
- EvilAlloc(ex::polymorphic_allocator<T> & a) : inner_(a) {}
- EvilAlloc(ex::polymorphic_allocator<T> && a) : inner_(a) {}
- EvilAlloc(ex::polymorphic_allocator<T> const & a) = delete;
- EvilAlloc(ex::polymorphic_allocator<T> const && a) = delete;
-
- using value_type = T;
- template <class U> EvilAlloc(EvilAlloc<U> const & rhs) : inner_(rhs.inner_) {}
-
- ex::polymorphic_allocator<T> inner_;
-};
-
-struct WidgetV0 {
- WidgetV0(int v) : value_(v) {}
-
- bool holds(int v, const ex::polymorphic_allocator<char>&) const {
- return value_ == v;
- }
-private:
- int value_;
-};
-
-struct WidgetV1 {
- using allocator_type = EvilAlloc<char>;
-
- WidgetV1(int v) : value_(v), alloc_() {}
- WidgetV1(std::allocator_arg_t, EvilAlloc<char> a, int v) : value_(v), alloc_(a) {}
-
- bool holds(int v, const ex::polymorphic_allocator<char>& a) const {
- return value_ == v && alloc_.inner_ == a;
- }
-private:
- int value_;
- EvilAlloc<char> alloc_;
-};
-
-struct WidgetV2 {
- using allocator_type = EvilAlloc<char>;
-
- WidgetV2(int v) : value_(v), alloc_() {}
- WidgetV2(int v, EvilAlloc<char> a) : value_(v), alloc_(a) {}
-
- bool holds(int v, ex::polymorphic_allocator<char> a) const {
- return value_ == v && alloc_.inner_ == a;
- }
-private:
- int value_;
- EvilAlloc<char> alloc_;
-};
-
-struct WidgetV3 {
- using allocator_type = EvilAlloc<char>;
-
- WidgetV3(int v) : value_(v), alloc_() {}
- WidgetV3(std::allocator_arg_t, EvilAlloc<char> a, int v) : value_(v), alloc_(a) {}
- WidgetV3(int v, EvilAlloc<char> a) : value_(v), alloc_(a) {}
-
- bool holds(int v, ex::polymorphic_allocator<char> a) const {
- return value_ == v && alloc_.inner_ == a;
- }
-private:
- int value_;
- EvilAlloc<char> alloc_;
-};
-
-static_assert(std::uses_allocator<WidgetV1, EvilAlloc<char>>::value, "");
-static_assert(std::uses_allocator<WidgetV2, EvilAlloc<char>>::value, "");
-static_assert(std::uses_allocator<WidgetV3, EvilAlloc<char>>::value, "");
-static_assert(std::uses_allocator<WidgetV1, ex::polymorphic_allocator<char>>::value, "");
-static_assert(std::uses_allocator<WidgetV2, ex::polymorphic_allocator<char>>::value, "");
-static_assert(std::uses_allocator<WidgetV3, ex::polymorphic_allocator<char>>::value, "");
-
-template<class W1, class W2>
-void test_evil()
-{
- using PMA = ex::polymorphic_allocator<char>;
- PMA pma(ex::new_delete_resource());
- {
- using Pair = std::pair<W1, W2>;
- void *where = std::malloc(sizeof (Pair));
- Pair *p = (Pair *)where;
- pma.construct(p, std::piecewise_construct, std::make_tuple(42), std::make_tuple(42));
- assert(p->first.holds(42, pma));
- assert(p->second.holds(42, pma));
- pma.destroy(p);
- std::free(where);
- }
-}
-
-int main(int, char**)
-{
- test_evil<WidgetV0, WidgetV0>();
- test_evil<WidgetV0, WidgetV1>();
- test_evil<WidgetV0, WidgetV2>();
- test_evil<WidgetV0, WidgetV3>();
- test_evil<WidgetV1, WidgetV0>();
- test_evil<WidgetV1, WidgetV1>();
- test_evil<WidgetV1, WidgetV2>();
- test_evil<WidgetV1, WidgetV3>();
- test_evil<WidgetV2, WidgetV0>();
- test_evil<WidgetV2, WidgetV1>();
- test_evil<WidgetV2, WidgetV2>();
- test_evil<WidgetV2, WidgetV3>();
- test_evil<WidgetV3, WidgetV0>();
- test_evil<WidgetV3, WidgetV1>();
- test_evil<WidgetV3, WidgetV2>();
- test_evil<WidgetV3, WidgetV3>();
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
deleted file mode 100644
index 2b7a46d1ef01dc8..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class U, class ...Args>
-// void polymorphic_allocator<T>::construct(U *, Args &&...)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-#include <cstdlib>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-#include "uses_alloc_types.h"
-#include "controlled_allocators.h"
-#include "test_allocator.h"
-
-namespace ex = std::experimental::pmr;
-
-template <class T>
-struct PMATest {
- TestResource R;
- ex::polymorphic_allocator<T> A;
- T* ptr;
- bool constructed;
-
- PMATest() : A(&R), ptr(A.allocate(1)), constructed(false) {}
-
- template <class ...Args>
- void construct(Args&&... args) {
- A.construct(ptr, std::forward<Args>(args)...);
- constructed = true;
- }
-
- ~PMATest() {
- if (constructed) A.destroy(ptr);
- A.deallocate(ptr, 1);
- }
-};
-
-template <class T, class ...Args>
-bool doTest(UsesAllocatorType UAExpect, Args&&... args)
-{
- PMATest<T> TH;
- // UNDER TEST //
- TH.construct(std::forward<Args>(args)...);
- return checkConstruct<Args&&...>(*TH.ptr, UAExpect, &TH.R);
- // ------- //
-}
-
-
-template <class T, class ...Args>
-bool doTestUsesAllocV0(Args&&... args)
-{
- PMATest<T> TH;
- // UNDER TEST //
- TH.construct(std::forward<Args>(args)...);
- return checkConstruct<Args&&...>(*TH.ptr, UA_None);
- // -------- //
-}
-
-
-template <class T, class EAlloc, class ...Args>
-bool doTestUsesAllocV1(EAlloc const& ealloc, Args&&... args)
-{
- PMATest<T> TH;
- // UNDER TEST //
- TH.construct(std::allocator_arg, ealloc, std::forward<Args>(args)...);
- return checkConstruct<Args&&...>(*TH.ptr, UA_AllocArg, ealloc);
- // -------- //
-}
-
-template <class T, class EAlloc, class ...Args>
-bool doTestUsesAllocV2(EAlloc const& ealloc, Args&&... args)
-{
- PMATest<T> TH;
- // UNDER TEST //
- TH.construct(std::forward<Args>(args)..., ealloc);
- return checkConstruct<Args&&...>(*TH.ptr, UA_AllocLast, ealloc);
- // -------- //
-}
-
-template <class Alloc, class ...Args>
-void test_pmr_uses_alloc(Args&&... args)
-{
- TestResource R(12435);
- ex::memory_resource* M = &R;
- {
- // NotUsesAllocator provides valid signatures for each uses-allocator
- // construction but does not supply the required allocator_type typedef.
- // Test that we can call these constructors manually without
- // polymorphic_allocator interfering.
- using T = NotUsesAllocator<Alloc, sizeof...(Args)>;
- assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...));
- assert((doTestUsesAllocV1<T>(M, std::forward<Args>(args)...)));
- assert((doTestUsesAllocV2<T>(M, std::forward<Args>(args)...)));
- }
- {
- // Test T(std::allocator_arg_t, Alloc const&, Args...) construction
- using T = UsesAllocatorV1<Alloc, sizeof...(Args)>;
- assert((doTest<T>(UA_AllocArg, std::forward<Args>(args)...)));
- }
- {
- // Test T(Args..., Alloc const&) construction
- using T = UsesAllocatorV2<Alloc, sizeof...(Args)>;
- assert((doTest<T>(UA_AllocLast, std::forward<Args>(args)...)));
- }
- {
- // Test that T(std::allocator_arg_t, Alloc const&, Args...) construction
- // is preferred when T(Args..., Alloc const&) is also available.
- using T = UsesAllocatorV3<Alloc, sizeof...(Args)>;
- assert((doTest<T>(UA_AllocArg, std::forward<Args>(args)...)));
- }
-}
-
-template <class Alloc, class ...Args>
-void test_pmr_not_uses_alloc(Args&&... args)
-{
- TestResource R(12435);
- ex::memory_resource* M = &R;
- {
- // NotUsesAllocator provides valid signatures for each uses-allocator
- // construction but does not supply the required allocator_type typedef.
- // Test that we can call these constructors manually without
- // polymorphic_allocator interfering.
- using T = NotUsesAllocator<Alloc, sizeof...(Args)>;
- assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...));
- assert((doTestUsesAllocV1<T>(M, std::forward<Args>(args)...)));
- assert((doTestUsesAllocV2<T>(M, std::forward<Args>(args)...)));
- }
- {
- // Test T(std::allocator_arg_t, Alloc const&, Args...) construction
- using T = UsesAllocatorV1<Alloc, sizeof...(Args)>;
- assert((doTest<T>(UA_None, std::forward<Args>(args)...)));
- }
- {
- // Test T(Args..., Alloc const&) construction
- using T = UsesAllocatorV2<Alloc, sizeof...(Args)>;
- assert((doTest<T>(UA_None, std::forward<Args>(args)...)));
- }
- {
- // Test that T(std::allocator_arg_t, Alloc const&, Args...) construction
- // is preferred when T(Args..., Alloc const&) is also available.
- using T = UsesAllocatorV3<Alloc, sizeof...(Args)>;
- assert((doTest<T>(UA_None, std::forward<Args>(args)...)));
- }
-}
-
-// Test that polymorphic_allocator does not prevent us from manually
-// doing non-pmr uses-allocator construction.
-template <class Alloc, class AllocObj, class ...Args>
-void test_non_pmr_uses_alloc(AllocObj const& A, Args&&... args)
-{
- {
- using T = NotUsesAllocator<Alloc, sizeof...(Args)>;
- assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...));
- assert((doTestUsesAllocV1<T>(A, std::forward<Args>(args)...)));
- assert((doTestUsesAllocV2<T>(A, std::forward<Args>(args)...)));
- }
- {
- using T = UsesAllocatorV1<Alloc, sizeof...(Args)>;
- assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...));
- assert((doTestUsesAllocV1<T>(A, std::forward<Args>(args)...)));
- }
- {
- using T = UsesAllocatorV2<Alloc, sizeof...(Args)>;
- assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...));
- assert((doTestUsesAllocV2<T>(A, std::forward<Args>(args)...)));
- }
- {
- using T = UsesAllocatorV3<Alloc, sizeof...(Args)>;
- assert(doTestUsesAllocV0<T>(std::forward<Args>(args)...));
- assert((doTestUsesAllocV1<T>(A, std::forward<Args>(args)...)));
- assert((doTestUsesAllocV2<T>(A, std::forward<Args>(args)...)));
- }
-}
-
-int main(int, char**)
-{
- using ET = std::experimental::erased_type;
- using PMR = ex::memory_resource*;
- using PMA = ex::polymorphic_allocator<void>;
- using STDA = std::allocator<char>;
- using TESTA = test_allocator<char>;
-
- int value = 42;
- const int cvalue = 43;
- {
- test_pmr_uses_alloc<ET>();
- test_pmr_not_uses_alloc<PMR>();
- test_pmr_uses_alloc<PMA>();
- test_pmr_uses_alloc<ET>(value);
- test_pmr_not_uses_alloc<PMR>(value);
- test_pmr_uses_alloc<PMA>(value);
- test_pmr_uses_alloc<ET>(cvalue);
- test_pmr_not_uses_alloc<PMR>(cvalue);
- test_pmr_uses_alloc<PMA>(cvalue);
- test_pmr_uses_alloc<ET>(cvalue, std::move(value));
- test_pmr_not_uses_alloc<PMR>(cvalue, std::move(value));
- test_pmr_uses_alloc<PMA>(cvalue, std::move(value));
- }
- {
- STDA std_alloc;
- TESTA test_alloc(42);
- test_non_pmr_uses_alloc<STDA>(std_alloc);
- test_non_pmr_uses_alloc<TESTA>(test_alloc);
- test_non_pmr_uses_alloc<STDA>(std_alloc, value);
- test_non_pmr_uses_alloc<TESTA>(test_alloc, value);
- test_non_pmr_uses_alloc<STDA>(std_alloc, cvalue);
- test_non_pmr_uses_alloc<TESTA>(test_alloc, cvalue);
- test_non_pmr_uses_alloc<STDA>(std_alloc, cvalue, std::move(value));
- test_non_pmr_uses_alloc<TESTA>(test_alloc, cvalue, std::move(value));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
deleted file mode 100644
index 1911ebd378b9e22..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// T* polymorphic_allocator<T>::deallocate(T*, size_t size)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-template <std::size_t S, size_t Align>
-void testForSizeAndAlign() {
- struct T { alignas(Align) char data[S]; };
-
- TestResource R;
- ex::polymorphic_allocator<T> a(&R);
-
- for (int N = 1; N <= 5; ++N) {
- auto ret = a.allocate(N);
- assert(R.checkAlloc(ret, N * sizeof(T), alignof(T)));
-
- a.deallocate(ret, N);
- assert(R.checkDealloc(ret, N * sizeof(T), alignof(T)));
-
- R.reset();
- }
-}
-
-int main(int, char**)
-{
- {
- ex::polymorphic_allocator<int> a;
- static_assert(
- std::is_same<decltype(a.deallocate(nullptr, 0)), void>::value, "");
- }
- {
- constexpr std::size_t MA = alignof(std::max_align_t);
- testForSizeAndAlign<1, 1>();
- testForSizeAndAlign<1, 2>();
- testForSizeAndAlign<1, MA>();
- testForSizeAndAlign<2, 2>();
- testForSizeAndAlign<73, alignof(void*)>();
- testForSizeAndAlign<73, MA>();
- testForSizeAndAlign<13, MA>();
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
deleted file mode 100644
index dc99d8aea63d420..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// template <class U>
-// void polymorphic_allocator<T>::destroy(U * ptr);
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <new>
-#include <cassert>
-#include <cstdlib>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int count = 0;
-
-struct destroyable
-{
- destroyable() { ++count; }
- ~destroyable() { --count; }
-};
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<double> A;
- {
- A a;
- static_assert(
- std::is_same<decltype(a.destroy((destroyable*)nullptr)), void>::value,
- "");
- }
- {
- destroyable * ptr = ::new (std::malloc(sizeof(destroyable))) destroyable();
- assert(count == 1);
- A{}.destroy(ptr);
- assert(count == 0);
- std::free(ptr);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
deleted file mode 100644
index e47784760bf02b1..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// memory_resource *
-// polymorphic_allocator<T>::resource() const
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<void> A;
- {
- A const a;
- static_assert(
- std::is_same<decltype(a.resource()), ex::memory_resource*>::value
- , ""
- );
- }
- {
- ex::memory_resource * mptr = (ex::memory_resource*)42;
- A const a(mptr);
- assert(a.resource() == mptr);
- }
- {
- A const a(nullptr);
- assert(a.resource() == nullptr);
- assert(a.resource() == nullptr);
- }
- {
- A const a;
- assert(a.resource() == ex::get_default_resource());
- }
- {
- ex::memory_resource * mptr = (ex::memory_resource*)42;
- ex::set_default_resource(mptr);
- A const a;
- assert(a.resource() == mptr);
- assert(a.resource() == ex::get_default_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp b/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
deleted file mode 100644
index 698773a2c5f16b3..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// template <class T> class polymorphic_allocator
-
-// polymorphic_allocator
-// polymorphic_allocator<T>::select_on_container_copy_construction() const
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::polymorphic_allocator<void> A;
- {
- A const a;
- static_assert(
- std::is_same<decltype(a.select_on_container_copy_construction()), A>::value,
- "");
- }
- {
- ex::memory_resource * mptr = (ex::memory_resource*)42;
- A const a(mptr);
- assert(a.resource() == mptr);
- A const other = a.select_on_container_copy_construction();
- assert(other.resource() == ex::get_default_resource());
- assert(a.resource() == mptr);
- }
- {
- ex::memory_resource * mptr = (ex::memory_resource*)42;
- ex::set_default_resource(mptr);
- A const a(nullptr);
- assert(a.resource() == nullptr);
- A const other = a.select_on_container_copy_construction();
- assert(other.resource() == ex::get_default_resource());
- assert(other.resource() == mptr);
- assert(a.resource() == nullptr);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_copy.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_copy.pass.cpp
deleted file mode 100644
index 0f43709cb5d719c..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_copy.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class Alloc> class resource_adaptor_imp;
-
-// resource_adaptor_imp<Alloc>::resource_adaptor_imp(Alloc const &)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef CountingAllocator<char> AllocT;
- typedef ex::resource_adaptor<AllocT> R;
- {
- AllocController P;
- AllocT const a(P);
- R const r(a);
- assert(P.copy_constructed == 1);
- assert(P.move_constructed == 0);
- assert(r.get_allocator() == a);
- }
- {
- AllocController P;
- AllocT a(P);
- R const r(a);
- assert(P.copy_constructed == 1);
- assert(P.move_constructed == 0);
- assert(r.get_allocator() == a);
- }
- {
- AllocController P;
- AllocT const a(P);
- R const r(std::move(a));
- assert(P.copy_constructed == 1);
- assert(P.move_constructed == 0);
- assert(r.get_allocator() == a);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_move.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_move.pass.cpp
deleted file mode 100644
index 1be7f3f30bde00c..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_move.pass.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class Alloc> class resource_adaptor_imp;
-
-// resource_adaptor_imp<Alloc>::resource_adaptor_imp(Alloc &&)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef CountingAllocator<char> AllocT;
- typedef ex::resource_adaptor<AllocT> R;
- {
- AllocController P;
- AllocT a(P);
- R const r(std::move(a));
- assert(P.copy_constructed == 0);
- assert(P.move_constructed == 1);
- assert(r.get_allocator() == a);
- }
- {
- AllocController P;
- R const r(AllocT{P});
- assert(P.copy_constructed == 0);
- assert(P.move_constructed == 1);
- assert(r.get_allocator() == AllocT{P});
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/default.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/default.pass.cpp
deleted file mode 100644
index c26a477820f6fdd..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/default.pass.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class Alloc> class resource_adaptor_imp;
-
-// resource_adaptor_imp<Alloc>::resource_adaptor_imp() = default;
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <memory>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- {
- typedef CountingAllocator<char> AllocT; // Not default constructible
- typedef ex::resource_adaptor<AllocT> R;
- static_assert(!std::is_default_constructible<R>::value, "");
- }
- {
- typedef std::allocator<char> AllocT; // Is default constructible
- typedef ex::resource_adaptor<AllocT> R;
- static_assert(std::is_default_constructible<R>::value, "");
- R r; ((void)r);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_allocate_and_deallocate.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_allocate_and_deallocate.pass.cpp
deleted file mode 100644
index f9ebeffe7a6059d..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_allocate_and_deallocate.pass.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class Alloc> class resource_adaptor_imp;
-
-// void * do_allocate(size_t size, size_t align)
-// void do_deallocate(void*, size_t, size_t)
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <memory>
-#include <exception>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-
-namespace ex = std::experimental::pmr;
-
-template <class Alloc>
-void check_allocate_deallocate()
-{
- typedef ex::resource_adaptor<Alloc> R1;
- const std::size_t max_align = alignof(std::max_align_t);
-
- for (std::size_t s = 1; s < 5012; ++s)
- {
- for(std::size_t align_req = 1; align_req <= (max_align * 2); align_req *= 2)
- {
- const std::size_t align_exp = align_req > max_align
- ? max_align : align_req;
- AllocController P;
- R1 r{Alloc(P)};
- ex::memory_resource & m1 = r;
-
- void * const ret = m1.allocate(s, align_req);
- assert(P.alive == 1);
- assert(P.alloc_count == 1);
- assert(P.checkAllocAtLeast(ret, s, align_exp));
-
- assert(((std::size_t)ret % align_exp) == 0);
-
- m1.deallocate(ret, s, align_req);
- assert(P.alive == 0);
- assert(P.dealloc_count == 1);
- assert(P.checkDeallocMatchesAlloc());
- }
- }
-}
-
-void check_alloc_max_size() {
- using Alloc = NullAllocator<char>;
- using R1 = ex::resource_adaptor<Alloc>;
- const std::size_t max_align = alignof(std::max_align_t);
-
- auto check = [=](std::size_t s, std::size_t align_req) {
- const std::size_t align_exp = align_req > max_align
- ? max_align : align_req;
- AllocController P;
- R1 r{Alloc(P)};
- ex::memory_resource & m1 = r;
-
- void * const ret = m1.allocate(s, align_req);
- assert(P.alive == 1);
- assert(P.alloc_count == 1);
- assert(P.checkAllocAtLeast(ret, s, align_exp));
-
- m1.deallocate(ret, s, align_req);
- assert(P.alive == 0);
- assert(P.dealloc_count == 1);
- assert(P.checkDeallocMatchesAlloc());
- };
-
- const std::size_t sizeTypeMax = ~0;
- const std::size_t testSizeStart = sizeTypeMax - (max_align * 3);
- const std::size_t testSizeEnd = sizeTypeMax - max_align;
-
- for (std::size_t size = testSizeStart; size <= testSizeEnd; ++size) {
- for (std::size_t align=1; align <= (max_align * 2); align *= 2) {
- check(size, align);
- }
- }
-
-#ifndef TEST_HAS_NO_EXCEPTIONS
- for (std::size_t size = sizeTypeMax; size > testSizeEnd; --size) {
- AllocController P;
- R1 r{Alloc(P)};
- ex::memory_resource & m1 = r;
-
- try {
- m1.allocate(size);
- assert(false);
- } catch (std::bad_array_new_length const&) {
- }
- }
-#endif
-}
-
-int main(int, char**)
-{
- check_allocate_deallocate<CountingAllocator<char>>();
- check_allocate_deallocate<MinAlignedAllocator<char>>();
- check_alloc_max_size();
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_is_equal.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_is_equal.pass.cpp
deleted file mode 100644
index 83777f75cb17128..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_is_equal.pass.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class Alloc> class resource_adaptor_imp;
-
-// bool do_is_equal(memory_resource const &) const noexcept;
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <memory>
-#include <cassert>
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-using std::size_t;
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
-
- typedef CountingAllocator<char> Alloc1;
- typedef CountingAllocator<int> RAlloc1;
- typedef ex::resource_adaptor<Alloc1> R1;
- typedef ex::resource_adaptor<RAlloc1> RR1;
- static_assert(std::is_same<R1, RR1>::value, "");
-
- typedef std::allocator<char> Alloc2;
- typedef ex::resource_adaptor<Alloc2> R2;
- static_assert(!std::is_same<R1, R2>::value, "");
-
- // equal same type
- {
- AllocController C;
- Alloc1 a1(C);
- R1 const r1(a1);
- ex::memory_resource const & m1 = r1;
-
- Alloc1 a2(C);
- R1 const r2(a2);
- ex::memory_resource const & m2 = r2;
-
- assert(m1.is_equal(m2));
- assert(m2.is_equal(m1));
- }
- // not equal same type
- {
- AllocController C;
- Alloc1 a1(C);
- R1 const r1(a1);
- ex::memory_resource const & m1 = r1;
-
- AllocController C2;
- Alloc1 a2(C2);
- R1 const r2(a2);
- ex::memory_resource const & m2 = r2;
-
- assert(!m1.is_equal(m2));
- assert(!m2.is_equal(m1));
- }
- //
diff erent allocator types
- {
- AllocController C;
- Alloc1 a1(C);
- R1 const r1(a1);
- ex::memory_resource const & m1 = r1;
-
- Alloc2 a2;
- R2 const r2(a2);
- ex::memory_resource const & m2 = r2;
-
- assert(!m1.is_equal(m2));
- assert(!m2.is_equal(m1));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.overview/overview.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.overview/overview.pass.cpp
deleted file mode 100644
index 59588247655a42d..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.overview/overview.pass.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// template <class Alloc> class resource_adaptor_imp;
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- typedef ex::resource_adaptor<std::allocator<int>> R;
- typedef ex::resource_adaptor<std::allocator<long>> R2;
- static_assert(std::is_same<R, R2>::value, "");
- {
- static_assert(std::is_base_of<ex::memory_resource, R>::value, "");
- static_assert(std::is_same<R::allocator_type, std::allocator<char>>::value, "");
- }
- {
- static_assert(std::is_default_constructible<R>::value, "");
- static_assert(std::is_copy_constructible<R>::value, "");
- static_assert(std::is_move_constructible<R>::value, "");
- static_assert(std::is_copy_assignable<R>::value, "");
- static_assert(std::is_move_assignable<R>::value, "");
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
deleted file mode 100644
index 6dc013b7f7cc2f4..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/deque>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class T>
-// using deque =
-// ::std::deque<T, polymorphic_allocator<T>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/deque>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-int main(int, char**)
-{
- using StdDeque = std::deque<int, pmr::polymorphic_allocator<int>>;
- using PmrDeque = pmr::deque<int>;
- static_assert(std::is_same<StdDeque, PmrDeque>::value, "");
- PmrDeque d;
- assert(d.get_allocator().resource() == pmr::get_default_resource());
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
deleted file mode 100644
index fa726ed1f5a389b..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/forward_list>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class T>
-// using forward_list =
-// ::std::forward_list<T, polymorphic_allocator<T>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/forward_list>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-int main(int, char**)
-{
- using StdForwardList = std::forward_list<int, pmr::polymorphic_allocator<int>>;
- using PmrForwardList = pmr::forward_list<int>;
- static_assert(std::is_same<StdForwardList, PmrForwardList>::value, "");
- PmrForwardList d;
- assert(d.get_allocator().resource() == pmr::get_default_resource());
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
deleted file mode 100644
index 5fee88359b857a7..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/list>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class T>
-// using list =
-// ::std::list<T, polymorphic_allocator<T>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/list>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-int main(int, char**)
-{
- using StdList = std::list<int, pmr::polymorphic_allocator<int>>;
- using PmrList = pmr::list<int>;
- static_assert(std::is_same<StdList, PmrList>::value, "");
- PmrList d;
- assert(d.get_allocator().resource() == pmr::get_default_resource());
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
deleted file mode 100644
index 2f7e9067a82b49b..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/map>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class K, class V, class Compare = less<Key> >
-// using map =
-// ::std::map<K, V, Compare, polymorphic_allocator<pair<const K, V>>>
-//
-// template <class K, class V, class Compare = less<Key> >
-// using multimap =
-// ::std::multimap<K, V, Compare, polymorphic_allocator<pair<const K, V>>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/map>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-int main(int, char**)
-{
- using K = int;
- using V = char;
- using DC = std::less<int>;
- using OC = std::greater<int>;
- using P = std::pair<const K, V>;
- {
- using StdMap = std::map<K, V, DC, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::map<K, V>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- using StdMap = std::map<K, V, OC, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::map<K, V, OC>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- pmr::map<int, int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
- {
- using StdMap = std::multimap<K, V, DC, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::multimap<K, V>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- using StdMap = std::multimap<K, V, OC, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::multimap<K, V, OC>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- pmr::multimap<int, int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
deleted file mode 100644
index 6d452bdfe35175e..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-// UNSUPPORTED: no-localization
-
-// <experimental/regex>
-
-// namespace std { namespace experimental { namespace pmr {
-//
-// template <class BidirectionalIterator>
-// using match_results =
-// std::match_results<BidirectionalIterator,
-// polymorphic_allocator<sub_match<BidirectionalIterator>>>;
-//
-// typedef match_results<const char*> cmatch;
-// typedef match_results<const wchar_t*> wcmatch;
-// typedef match_results<string::const_iterator> smatch;
-// typedef match_results<wstring::const_iterator> wsmatch;
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/regex>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-template <class Iter, class PmrTypedef>
-void test_match_result_typedef() {
- using StdMR = std::match_results<Iter, pmr::polymorphic_allocator<std::sub_match<Iter>>>;
- using PmrMR = pmr::match_results<Iter>;
- static_assert(std::is_same<StdMR, PmrMR>::value, "");
- static_assert(std::is_same<PmrMR, PmrTypedef>::value, "");
-}
-
-int main(int, char**)
-{
- {
- test_match_result_typedef<const char*, pmr::cmatch>();
- test_match_result_typedef<pmr::string::const_iterator, pmr::smatch>();
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
- test_match_result_typedef<const wchar_t*, pmr::wcmatch>();
- test_match_result_typedef<pmr::wstring::const_iterator, pmr::wsmatch>();
-#endif
- }
- {
- // Check that std::match_results has been included and is complete.
- pmr::smatch s;
- assert(s.get_allocator().resource() == pmr::get_default_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
deleted file mode 100644
index b6f1251027342e8..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/set>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class V, class Compare = less<V> >
-// using set =
-// ::std::set<V, Compare, polymorphic_allocator<V>>
-//
-// template <class V, class Compare = less<V> >
-// using multiset =
-// ::std::multiset<V, Compare, polymorphic_allocator<V>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/set>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-int main(int, char**)
-{
- using V = char;
- using DC = std::less<V>;
- using OC = std::greater<V>;
- {
- using StdSet = std::set<V, DC, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::set<V>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- using StdSet = std::set<V, OC, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::set<V, OC>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- pmr::set<int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
- {
- using StdSet = std::multiset<V, DC, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::multiset<V>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- using StdSet = std::multiset<V, OC, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::multiset<V, OC>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- pmr::multiset<int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
deleted file mode 100644
index ddd2783d17ce1b7..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/string>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class Char, class Traits = ...>
-// using basic_string =
-// ::std::basic_string<Char, Traits, polymorphic_allocator<Char>>
-//
-// typedef ... string
-// typedef ... u16string
-// typedef ... u32string
-// typedef ... wstring
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/string>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "constexpr_char_traits.h"
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-template <class Char, class PmrTypedef>
-void test_string_typedef() {
- using StdStr = std::basic_string<Char, std::char_traits<Char>,
- pmr::polymorphic_allocator<Char>>;
- using PmrStr = pmr::basic_string<Char>;
- static_assert(std::is_same<StdStr, PmrStr>::value, "");
- static_assert(std::is_same<PmrStr, PmrTypedef>::value, "");
-}
-
-template <class Char, class Traits>
-void test_basic_string_alias() {
- using StdStr = std::basic_string<Char, Traits,
- pmr::polymorphic_allocator<Char>>;
- using PmrStr = pmr::basic_string<Char, Traits>;
- static_assert(std::is_same<StdStr, PmrStr>::value, "");
-}
-
-int main(int, char**)
-{
- {
- test_string_typedef<char, pmr::string>();
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
- test_string_typedef<wchar_t, pmr::wstring>();
-#endif
- test_string_typedef<char16_t, pmr::u16string>();
- test_string_typedef<char32_t, pmr::u32string>();
- }
- {
- test_basic_string_alias<char, constexpr_char_traits<char>>();
-#ifndef TEST_HAS_NO_WIDE_CHARACTERS
- test_basic_string_alias<wchar_t, constexpr_char_traits<wchar_t>>();
-#endif
- test_basic_string_alias<char16_t, constexpr_char_traits<char16_t>>();
- test_basic_string_alias<char32_t, constexpr_char_traits<char32_t>>();
- }
- {
- // Check that std::basic_string has been included and is complete.
- pmr::string s;
- assert(s.get_allocator().resource() == pmr::get_default_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
deleted file mode 100644
index b7dcdf698d7a280..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/unordered_map>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class K, class V, class H = hash<K>, class P = equal_to<K> >
-// using unordered_map =
-// ::std::unordered_map<K, V, H, P, polymorphic_allocator<pair<const K, V>>>
-//
-// template <class K, class V, class H = hash<K>, class P = equal_to<K> >
-// using unordered_multimap =
-// ::std::unordered_multimap<K, V, H, P, polymorphic_allocator<pair<const K, V>>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/unordered_map>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-template <class T>
-struct MyHash : std::hash<T> {};
-
-template <class T>
-struct MyPred : std::equal_to<T> {};
-
-int main(int, char**)
-{
- using K = int;
- using V = char;
- using DH = std::hash<K>;
- using MH = MyHash<K>;
- using DP = std::equal_to<K>;
- using MP = MyPred<K>;
- using P = std::pair<const K, V>;
- {
- using StdMap = std::unordered_map<K, V, DH, DP, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::unordered_map<K, V>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- using StdMap = std::unordered_map<K, V, MH, DP, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::unordered_map<K, V, MH>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- using StdMap = std::unordered_map<K, V, MH, MP, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::unordered_map<K, V, MH, MP>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- pmr::unordered_map<int, int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
- {
- using StdMap = std::unordered_multimap<K, V, DH, DP, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::unordered_multimap<K, V>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- using StdMap = std::unordered_multimap<K, V, MH, DP, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::unordered_multimap<K, V, MH>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- using StdMap = std::unordered_multimap<K, V, MH, MP, pmr::polymorphic_allocator<P>>;
- using PmrMap = pmr::unordered_multimap<K, V, MH, MP>;
- static_assert(std::is_same<StdMap, PmrMap>::value, "");
- }
- {
- pmr::unordered_multimap<int, int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
deleted file mode 100644
index 30908dd7ee38ebe..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/unordered_set>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class V, class H = hash<V>, class P = equal_to<V> >
-// using unordered_set =
-// ::std::unordered_set<V, H, P, polymorphic_allocator<V>>
-//
-// template <class V, class H = hash<V>, class P = equal_to<V> >
-// using unordered_multiset =
-// ::std::unordered_multiset<V, H, P, polymorphic_allocator<V>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/unordered_set>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-template <class T>
-struct MyHash : std::hash<T> {};
-
-template <class T>
-struct MyPred : std::equal_to<T> {};
-
-int main(int, char**)
-{
- using V = char;
- using DH = std::hash<V>;
- using MH = MyHash<V>;
- using DP = std::equal_to<V>;
- using MP = MyPred<V>;
- {
- using StdSet = std::unordered_set<V, DH, DP, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::unordered_set<V>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- using StdSet = std::unordered_set<V, MH, DP, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::unordered_set<V, MH>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- using StdSet = std::unordered_set<V, MH, MP, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::unordered_set<V, MH, MP>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- pmr::unordered_set<int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
- {
- using StdSet = std::unordered_multiset<V, DH, DP, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::unordered_multiset<V>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- using StdSet = std::unordered_multiset<V, MH, DP, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::unordered_multiset<V, MH>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- using StdSet = std::unordered_multiset<V, MH, MP, pmr::polymorphic_allocator<V>>;
- using PmrSet = pmr::unordered_multiset<V, MH, MP>;
- static_assert(std::is_same<StdSet, PmrSet>::value, "");
- }
- {
- pmr::unordered_multiset<int> m;
- assert(m.get_allocator().resource() == pmr::get_default_resource());
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
deleted file mode 100644
index f2dbcd323cbe3f1..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/vector>
-
-// namespace std { namespace experimental { namespace pmr {
-// template <class T>
-// using vector =
-// ::std::vector<T, polymorphic_allocator<T>>
-//
-// }}} // namespace std::experimental::pmr
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/vector>
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace pmr = std::experimental::pmr;
-
-int main(int, char**)
-{
- using StdVector = std::vector<int, pmr::polymorphic_allocator<int>>;
- using PmrVector = pmr::vector<int>;
- static_assert(std::is_same<StdVector, PmrVector>::value, "");
- PmrVector d;
- assert(d.get_allocator().resource() == pmr::get_default_resource());
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp
deleted file mode 100644
index 35f3f4a6eea0cb1..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-//-----------------------------------------------------------------------------
-// TESTING memory_resource * get_default_resource() noexcept;
-// memory_resource * set_default_resource(memory_resource*) noexcept;
-//
-// Concerns:
-// A) 'get_default_resource()' returns a non-null memory_resource pointer.
-// B) 'get_default_resource()' returns the value set by the last call to
-// 'set_default_resource(...)' and 'new_delete_resource()' if no call
-// to 'set_default_resource(...)' has occurred.
-// C) 'set_default_resource(...)' returns the previous value of the default
-// resource.
-// D) 'set_default_resource(T* p)' for a non-null 'p' sets the default resource
-// to be 'p'.
-// E) 'set_default_resource(null)' sets the default resource to
-// 'new_delete_resource()'.
-// F) 'get_default_resource' and 'set_default_resource' are noexcept.
-
-
-#include <experimental/memory_resource>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-using namespace std::experimental::pmr;
-
-int main(int, char**) {
- TestResource R;
- { // Test (A) and (B)
- memory_resource* p = get_default_resource();
- assert(p != nullptr);
- assert(p == new_delete_resource());
- assert(p == get_default_resource());
- }
- { // Test (C) and (D)
- memory_resource *expect = &R;
- memory_resource *old = set_default_resource(expect);
- assert(old != nullptr);
- assert(old == new_delete_resource());
-
- memory_resource *p = get_default_resource();
- assert(p != nullptr);
- assert(p == expect);
- assert(p == get_default_resource());
- }
- { // Test (E)
- memory_resource* old = set_default_resource(nullptr);
- assert(old == &R);
- memory_resource* p = get_default_resource();
- assert(p != nullptr);
- assert(p == new_delete_resource());
- assert(p == get_default_resource());
- }
- { // Test (F)
- static_assert(noexcept(get_default_resource()),
- "get_default_resource() must be noexcept");
-
- static_assert(noexcept(set_default_resource(nullptr)),
- "set_default_resource() must be noexcept");
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
deleted file mode 100644
index a6223123cd97be6..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// memory_resource * new_delete_resource()
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "count_new.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-struct assert_on_compare : public ex::memory_resource
-{
-protected:
- void * do_allocate(std::size_t, size_t) override
- { assert(false); return nullptr; }
-
- void do_deallocate(void *, std::size_t, size_t) override
- { assert(false); }
-
- bool do_is_equal(ex::memory_resource const &) const noexcept override
- { assert(false); return false; }
-};
-
-void test_return()
-{
- {
- static_assert(std::is_same<
- decltype(ex::new_delete_resource()), ex::memory_resource*
- >::value, "");
- }
- // assert not null
- {
- assert(ex::new_delete_resource());
- }
- // assert same return value
- {
- assert(ex::new_delete_resource() == ex::new_delete_resource());
- }
-}
-
-void test_equality()
-{
- // Same object
- {
- ex::memory_resource & r1 = *ex::new_delete_resource();
- ex::memory_resource & r2 = *ex::new_delete_resource();
- // check both calls returned the same object
- assert(&r1 == &r2);
- // check for proper equality semantics
- assert(r1 == r2);
- assert(r2 == r1);
- assert(!(r1 != r2));
- assert(!(r2 != r1));
- }
- // Different types
- {
- ex::memory_resource & r1 = *ex::new_delete_resource();
- assert_on_compare c;
- ex::memory_resource & r2 = c;
- assert(r1 != r2);
- assert(!(r1 == r2));
- }
-}
-
-void test_allocate_deallocate()
-{
- ex::memory_resource & r1 = *ex::new_delete_resource();
-
- globalMemCounter.reset();
-
- void *ret = r1.allocate(50);
- assert(ret);
- assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(globalMemCounter.checkLastNewSizeEq(50));
-
- r1.deallocate(ret, 1);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(globalMemCounter.checkDeleteCalledEq(1));
-
-}
-
-int main(int, char**)
-{
- static_assert(noexcept(ex::new_delete_resource()), "Must be noexcept");
- test_return();
- test_equality();
- test_allocate_deallocate();
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
deleted file mode 100644
index e1bb4c4a7a00d20..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// memory_resource * null_memory_resource()
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <new>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-#include "count_new.h"
-
-namespace ex = std::experimental::pmr;
-
-struct assert_on_compare : public ex::memory_resource
-{
-protected:
- void * do_allocate(std::size_t, size_t) override
- { assert(false); return nullptr; }
-
- void do_deallocate(void *, std::size_t, size_t) override
- { assert(false); }
-
- bool do_is_equal(ex::memory_resource const &) const noexcept override
- { assert(false); return false; }
-};
-
-void test_return()
-{
- {
- static_assert(std::is_same<
- decltype(ex::null_memory_resource()), ex::memory_resource*
- >::value, "");
- }
- // Test that the returned value is not null
- {
- assert(ex::null_memory_resource());
- }
- // Test the same value is returned by repeated calls.
- {
- assert(ex::null_memory_resource() == ex::null_memory_resource());
- }
-}
-
-void test_equality()
-{
- // Same object
- {
- ex::memory_resource & r1 = *ex::null_memory_resource();
- ex::memory_resource & r2 = *ex::null_memory_resource();
- // check both calls returned the same object
- assert(&r1 == &r2);
- // check for proper equality semantics
- assert(r1 == r2);
- assert(r2 == r1);
- assert(!(r1 != r2));
- assert(!(r2 != r1));
- // check the is_equal method
- assert(r1.is_equal(r2));
- assert(r2.is_equal(r1));
- }
- // Different types
- {
- ex::memory_resource & r1 = *ex::null_memory_resource();
- assert_on_compare c;
- ex::memory_resource & r2 = c;
- assert(r1 != r2);
- assert(!(r1 == r2));
- assert(!r1.is_equal(r2));
- }
-}
-
-void test_allocate()
-{
-#ifndef TEST_HAS_NO_EXCEPTIONS
- DisableAllocationGuard g; // null_memory_resource shouldn't allocate.
- try {
- ex::null_memory_resource()->allocate(1);
- assert(false);
- } catch (std::bad_alloc const &) {
- // do nothing
- } catch (...) {
- assert(false);
- }
-#endif
-}
-
-void test_deallocate()
-{
- globalMemCounter.reset();
-
- int x = 42;
- ex::null_memory_resource()->deallocate(nullptr, 0);
- ex::null_memory_resource()->deallocate(&x, 0);
-
- assert(globalMemCounter.checkDeleteCalledEq(0));
- assert(globalMemCounter.checkDeleteArrayCalledEq(0));
-}
-
-int main(int, char**)
-{
- test_return();
- test_equality();
- test_allocate();
- test_deallocate();
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource.synop/nothing_to_do.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.synop/nothing_to_do.pass.cpp
deleted file mode 100644
index 1f764da05d6b5f5..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource.synop/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/construct.verify.cpp b/libcxx/test/std/experimental/memory/memory.resource/construct.verify.cpp
deleted file mode 100644
index 2a6a927b9d516d2..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/construct.verify.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// Check that memory_resource is not constructible
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- ex::memory_resource m; // expected-error {{variable type 'ex::memory_resource' is an abstract class}}
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/equal.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/equal.pass.cpp
deleted file mode 100644
index 0b007eef73aa664..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/equal.pass.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// bool operator==(memory_resource const &, memory_resource const &) noexcept;
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- // check return types
- {
- ex::memory_resource const * mr1(nullptr);
- ex::memory_resource const * mr2(nullptr);
- static_assert(std::is_same<decltype(*mr1 == *mr2), bool>::value, "");
- static_assert(noexcept(*mr1 == *mr2), "");
- }
- // equal
- {
- TestResource r1(1);
- TestResource r2(1);
- ex::memory_resource const & mr1 = r1;
- ex::memory_resource const & mr2 = r2;
-
- assert(mr1 == mr2);
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(0));
-
- assert(mr2 == mr1);
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(1));
- }
- // equal same object
- {
- TestResource r1(1);
- ex::memory_resource const & mr1 = r1;
- ex::memory_resource const & mr2 = r1;
-
- assert(mr1 == mr2);
- assert(r1.checkIsEqualCalledEq(0));
-
- assert(mr2 == mr1);
- assert(r1.checkIsEqualCalledEq(0));
- }
- // not equal
- {
- TestResource r1(1);
- TestResource r2(2);
- ex::memory_resource const & mr1 = r1;
- ex::memory_resource const & mr2 = r2;
-
- assert(!(mr1 == mr2));
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(0));
-
- assert(!(mr2 == mr1));
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(1));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/not_equal.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/not_equal.pass.cpp
deleted file mode 100644
index 182b335e50514f4..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/not_equal.pass.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-// bool operator!=(memory_resource const &, memory_resource const &) noexcept;
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
- // check return types
- {
- ex::memory_resource const * mr1(nullptr);
- ex::memory_resource const * mr2(nullptr);
- static_assert(std::is_same<decltype(*mr1 != *mr2), bool>::value, "");
- static_assert(noexcept(*mr1 != *mr2), "");
- }
- // not equal
- {
- TestResource r1(1);
- TestResource r2(2);
- ex::memory_resource const & mr1 = r1;
- ex::memory_resource const & mr2 = r2;
-
- assert(mr1 != mr2);
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(0));
-
- assert(mr2 != mr1);
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(1));
- }
- // equal
- {
- TestResource r1(1);
- TestResource r2(1);
- ex::memory_resource const & mr1 = r1;
- ex::memory_resource const & mr2 = r2;
-
- assert(!(mr1 != mr2));
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(0));
-
- assert(!(mr2 != mr1));
- assert(r1.checkIsEqualCalledEq(1));
- assert(r2.checkIsEqualCalledEq(1));
- }
- // equal same object
- {
- TestResource r1(1);
- ex::memory_resource const & mr1 = r1;
- ex::memory_resource const & mr2 = r1;
-
- assert(!(mr1 != mr2));
- assert(r1.checkIsEqualCalledEq(0));
-
- assert(!(mr2 != mr1));
- assert(r1.checkIsEqualCalledEq(0));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.overview/nothing_to_do.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.overview/nothing_to_do.pass.cpp
deleted file mode 100644
index 796f3c353ba17d4..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.overview/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/private_members.verify.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/private_members.verify.cpp
deleted file mode 100644
index 0a0353861fb0174..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/private_members.verify.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <experimental/memory_resource>
-
-// memory_resource::do_allocate(size_t, size_t); /* private */
-// memory_resource::do_deallocate(void*, size_t, size_t); /* private */
-// memory_resource::do_is_equal(memory_resource const&); /* private */
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**) {
- ex::memory_resource *m = ex::new_delete_resource();
- m->do_allocate(0, 0); // expected-error{{'do_allocate' is a private member}}
- m->do_deallocate(nullptr, 0, 0); // expected-error{{'do_deallocate' is a private member}}
- m->do_is_equal(*m); // expected-error{{'do_is_equal' is a private member}}
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp
deleted file mode 100644
index f09c820e1e1d121..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-//------------------------------------------------------------------------------
-// TESTING void * memory_resource::allocate(size_t, size_t = max_align)
-//
-// Concerns:
-// A) 'memory_resource' contains a member 'allocate' with the required
-// signature, including the default alignment parameter.
-// B) The return type of 'allocate' is 'void*'.
-// C) 'allocate' is not marked as 'noexcept'.
-// D) Invoking 'allocate' invokes 'do_allocate' with the same arguments.
-// E) If 'do_allocate' throws then 'allocate' propagates that exception.
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cstddef>
-#include <cassert>
-
-#include "test_macros.h"
-#include "test_memory_resource.h"
-
-using std::experimental::pmr::memory_resource;
-
-int main(int, char**)
-{
- TestResource R(42);
- auto& P = R.getController();
- memory_resource& M = R;
- {
- static_assert(
- std::is_same<decltype(M.allocate(0, 0)), void*>::value
- , "Must be void*"
- );
- static_assert(
- std::is_same<decltype(M.allocate(0)), void*>::value
- , "Must be void*"
- );
- }
- {
- static_assert(
- ! noexcept(M.allocate(0, 0))
- , "Must not be noexcept."
- );
- static_assert(
- ! noexcept(M.allocate(0))
- , "Must not be noexcept."
- );
- }
- {
- int s = 42;
- int a = 64;
- void* p = M.allocate(s, a);
- assert(P.alloc_count == 1);
- assert(P.checkAlloc(p, s, a));
-
- s = 128;
- a = MaxAlignV;
- p = M.allocate(s);
- assert(P.alloc_count == 2);
- assert(P.checkAlloc(p, s, a));
- }
-#ifndef TEST_HAS_NO_EXCEPTIONS
- {
- TestResource R2;
- auto& P2 = R2.getController();
- P2.throw_on_alloc = true;
- memory_resource& M2 = R2;
- try {
- M2.allocate(42);
- assert(false);
- } catch (TestException const&) {
- // do nothing.
- } catch (...) {
- assert(false);
- }
- }
-#endif
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/deallocate.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/deallocate.pass.cpp
deleted file mode 100644
index f23db0f9c4bed7f..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/deallocate.pass.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-//------------------------------------------------------------------------------
-// TESTING void * memory_resource::deallocate(void *, size_t, size_t = max_align)
-//
-// Concerns:
-// A) 'memory_resource' contains a member 'deallocate' with the required
-// signature, including the default alignment parameter.
-// B) The return type of 'deallocate' is 'void'.
-// C) 'deallocate' is not marked as 'noexcept'.
-// D) Invoking 'deallocate' invokes 'do_deallocate' with the same arguments.
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cstddef>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-using std::experimental::pmr::memory_resource;
-
-int main(int, char**)
-{
- NullResource R(42);
- auto& P = R.getController();
- memory_resource& M = R;
- {
- static_assert(
- std::is_same<decltype(M.deallocate(nullptr, 0, 0)), void>::value
- , "Must be void"
- );
- static_assert(
- std::is_same<decltype(M.deallocate(nullptr, 0)), void>::value
- , "Must be void"
- );
- }
- {
- static_assert(
- ! noexcept(M.deallocate(nullptr, 0, 0))
- , "Must not be noexcept."
- );
- static_assert(
- ! noexcept(M.deallocate(nullptr, 0))
- , "Must not be noexcept."
- );
- }
- {
- int s = 100;
- int a = 64;
- void* p = reinterpret_cast<void*>(640);
- M.deallocate(p, s, a);
- assert(P.dealloc_count == 1);
- assert(P.checkDealloc(p, s, a));
-
- s = 128;
- a = alignof(std::max_align_t);
- p = reinterpret_cast<void*>(12800);
- M.deallocate(p, s);
- assert(P.dealloc_count == 2);
- assert(P.checkDealloc(p, s, a));
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/dtor.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/dtor.pass.cpp
deleted file mode 100644
index 51bcd228dabe4ee..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/dtor.pass.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-//------------------------------------------------------------------------------
-// TESTING virtual ~memory_resource()
-//
-// Concerns:
-// A) 'memory_resource' is destructible.
-// B) The destructor is implicitly marked noexcept.
-// C) The destructor is marked virtual.
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-using std::experimental::pmr::memory_resource;
-
-int main(int, char**)
-{
- static_assert(
- std::has_virtual_destructor<memory_resource>::value
- , "Must have virtual destructor"
- );
- static_assert(
- std::is_nothrow_destructible<memory_resource>::value,
- "Must be nothrow destructible"
- );
- static_assert(
- std::is_abstract<memory_resource>::value
- , "Must be abstract"
- );
- // Check that the destructor of `TestResource` is called when
- // it is deleted as a pointer to `memory_resource`
- {
- using TR = TestResource;
- memory_resource* M = new TR(42);
- assert(TR::resource_alive == 1);
- assert(TR::resource_constructed == 1);
- assert(TR::resource_destructed == 0);
-
- delete M;
-
- assert(TR::resource_alive == 0);
- assert(TR::resource_constructed == 1);
- assert(TR::resource_destructed == 1);
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/is_equal.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/is_equal.pass.cpp
deleted file mode 100644
index ab636f73f7a286f..000000000000000
--- a/libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/is_equal.pass.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// test_memory_resource requires RTTI for dynamic_cast
-// UNSUPPORTED: no-rtti
-
-// <experimental/memory_resource>
-
-//------------------------------------------------------------------------------
-// TESTING virtual bool is_equal(memory_resource const &) const noexcept
-//
-// Concerns:
-// A) 'memory_resource' provides a function 'is_equal' with the required
-// signature.
-// B) 'is_equal' is noexcept.
-// C) 'do_is_equal' is called using the same arguments passed to 'is_equal'
-// and the resulting value is returned.
-// D) 'do_is_equal' is called on the LHS object and not the RHS object.
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-
-using std::experimental::pmr::memory_resource;
-
-int main(int, char**)
-{
- {
- memory_resource const* r1 = nullptr;
- memory_resource const* r2 = nullptr;
- static_assert(
- noexcept(r1->is_equal(*r2))
- , "is_equal must be noexcept"
- );
- }
- {
- TestResource1 R1(1);
- auto& P1 = R1.getController();
- memory_resource const& M1 = R1;
-
- TestResource2 R2(1);
- auto& P2 = R2.getController();
- memory_resource const& M2 = R2;
-
- assert(M1.is_equal(M2) == false);
- assert(P1.checkIsEqualCalledEq(1));
- assert(P2.checkIsEqualCalledEq(0));
-
- assert(M2.is_equal(M1) == false);
- assert(P2.checkIsEqualCalledEq(1));
- assert(P1.checkIsEqualCalledEq(1));
- }
- {
- TestResource1 R1(1);
- auto& P1 = R1.getController();
- memory_resource const& M1 = R1;
-
- TestResource1 R2(2);
- auto& P2 = R2.getController();
- memory_resource const& M2 = R2;
-
- assert(M1.is_equal(M2) == false);
- assert(P1.checkIsEqualCalledEq(1));
- assert(P2.checkIsEqualCalledEq(0));
-
- assert(M2.is_equal(M1) == false);
- assert(P2.checkIsEqualCalledEq(1));
- assert(P1.checkIsEqualCalledEq(1));
- }
- {
- TestResource1 R1(1);
- auto& P1 = R1.getController();
- memory_resource const& M1 = R1;
-
- TestResource1 R2(1);
- auto& P2 = R2.getController();
- memory_resource const& M2 = R2;
-
- assert(M1.is_equal(M2) == true);
- assert(P1.checkIsEqualCalledEq(1));
- assert(P2.checkIsEqualCalledEq(0));
-
- assert(M2.is_equal(M1) == true);
- assert(P2.checkIsEqualCalledEq(1));
- assert(P1.checkIsEqualCalledEq(1));
- }
-
- return 0;
-}
diff --git a/libcxx/test/support/test_memory_resource.h b/libcxx/test/support/test_memory_resource.h
deleted file mode 100644
index 280cdae1c619d7a..000000000000000
--- a/libcxx/test/support/test_memory_resource.h
+++ /dev/null
@@ -1,170 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SUPPORT_TEST_MEMORY_RESOURCE_H
-#define SUPPORT_TEST_MEMORY_RESOURCE_H
-
-#include <experimental/memory_resource>
-#include <experimental/utility>
-#include <memory>
-#include <type_traits>
-#include <cstddef>
-#include <cstdlib>
-#include <cstring>
-#include <cstdint>
-#include <cassert>
-#include "test_macros.h"
-#include "controlled_allocators.h"
-#include "uses_alloc_types.h"
-
-// FIXME: This is a hack to allow uses_allocator_types.hpp to work with
-// erased_type. However we can't define that behavior directly in the header
-// because it can't include <experimental/memory_resource>
-template <>
-struct TransformErasedTypeAlloc<std::experimental::erased_type> {
- using type = std::experimental::pmr::polymorphic_allocator<int>;
-};
-
-template <class ProviderT, int = 0>
-class TestResourceImp : public std::experimental::pmr::memory_resource
-{
-public:
- static int resource_alive;
- static int resource_constructed;
- static int resource_destructed;
-
- static void resetStatics() {
- assert(resource_alive == 0);
- resource_alive = 0;
- resource_constructed = 0;
- resource_destructed = 0;
- }
-
- using memory_resource = std::experimental::pmr::memory_resource;
- using Provider = ProviderT;
-
- int value;
-
- explicit TestResourceImp(int val = 0) : value(val) {
- ++resource_alive;
- ++resource_constructed;
- }
-
- ~TestResourceImp() noexcept {
- --resource_alive;
- ++resource_destructed;
- }
-
- void reset() { C.reset(); P.reset(); }
- AllocController& getController() { return C; }
-
- bool checkAlloc(void* p, std::size_t s, std::size_t a) const
- { return C.checkAlloc(p, s, a); }
-
- bool checkDealloc(void* p, std::size_t s, std::size_t a) const
- { return C.checkDealloc(p, s, a); }
-
- bool checkIsEqualCalledEq(int n) const { return C.checkIsEqualCalledEq(n); }
-
-protected:
- virtual void * do_allocate(std::size_t s, std::size_t a) {
- if (C.throw_on_alloc) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- throw TestException{};
-#else
- assert(false);
-#endif
- }
- void* ret = P.allocate(s, a);
- C.countAlloc(ret, s, a);
- return ret;
- }
-
- virtual void do_deallocate(void * p, std::size_t s, std::size_t a) {
- C.countDealloc(p, s, a);
- P.deallocate(p, s, a);
- }
-
- virtual bool do_is_equal(memory_resource const & other) const noexcept {
- C.countIsEqual();
- TestResourceImp const * o = dynamic_cast<TestResourceImp const *>(&other);
- return o && o->value == value;
- }
-private:
- mutable AllocController C;
- mutable Provider P;
- DISALLOW_COPY(TestResourceImp);
-};
-
-template <class Provider, int N>
-int TestResourceImp<Provider, N>::resource_alive = 0;
-
-template <class Provider, int N>
-int TestResourceImp<Provider, N>::resource_constructed = 0;
-
-template <class Provider, int N>
-int TestResourceImp<Provider, N>::resource_destructed = 0;
-
-
-struct NullProvider {
- NullProvider() {}
- void* allocate(std::size_t, size_t) { return nullptr; }
- void deallocate(void*, std::size_t, size_t) {}
- void reset() {}
-private:
- DISALLOW_COPY(NullProvider);
-};
-
-struct NewDeleteProvider {
- NewDeleteProvider() {}
- void* allocate(std::size_t s, size_t) { return ::operator new(s); }
- void deallocate(void* p, std::size_t, size_t) { ::operator delete(p); }
- void reset() {}
-private:
- DISALLOW_COPY(NewDeleteProvider);
-};
-
-template <std::size_t Size = 4096 * 10> // 10 pages worth of memory.
-struct BufferProvider {
- char buffer[Size];
- void* next = &buffer;
- std::size_t space = Size;
-
- BufferProvider() {}
-
- void* allocate(std::size_t s, size_t a) {
- void* ret = std::align(s, a, next, space);
- if (ret == nullptr) {
-#ifndef TEST_HAS_NO_EXCEPTIONS
- throw std::bad_alloc();
-#else
- assert(false);
-#endif
- }
-
- return ret;
- }
-
- void deallocate(void*, std::size_t, size_t) {}
-
- void reset() {
- next = &buffer;
- space = Size;
- }
-private:
- DISALLOW_COPY(BufferProvider);
-};
-
-using NullResource = TestResourceImp<NullProvider, 0>;
-using NewDeleteResource = TestResourceImp<NewDeleteProvider, 0>;
-using TestResource = TestResourceImp<BufferProvider<>, 0>;
-using TestResource1 = TestResourceImp<BufferProvider<>, 1>;
-using TestResource2 = TestResourceImp<BufferProvider<>, 2>;
-
-
-#endif /* SUPPORT_TEST_MEMORY_RESOURCE_H */
diff --git a/libcxx/test/support/uses_alloc_types.h b/libcxx/test/support/uses_alloc_types.h
index ab0e595ef64bacc..817bef1da3aef68 100644
--- a/libcxx/test/support/uses_alloc_types.h
+++ b/libcxx/test/support/uses_alloc_types.h
@@ -122,16 +122,6 @@ using EnableIfB = typename std::enable_if<Value, bool>::type;
} // end namespace detail
-// FIXME: UsesAllocatorTestBase needs some special logic to deal with
-// polymorphic allocators. However we don't want to include
-// <experimental/memory_resource> in this header. Therefore in order
-// to inject this behavior later we use a trait.
-// See test_memory_resource.h for more info.
-template <class Alloc>
-struct TransformErasedTypeAlloc {
- using type = Alloc;
-};
-
using detail::EnableIfB;
struct AllocLastTag {};
@@ -169,7 +159,7 @@ struct UsesAllocatorTestBaseStorage<Alloc, false> {
template <class Self, class Alloc>
struct UsesAllocatorTestBase {
public:
- using CtorAlloc = typename TransformErasedTypeAlloc<Alloc>::type;
+ using CtorAlloc = Alloc;
template <class... ArgTypes>
bool checkConstruct(UsesAllocatorType expectType) const {
diff --git a/libcxx/utils/libcxx/header_information.py b/libcxx/utils/libcxx/header_information.py
index b0e1cafe6ccf4f0..54e18b5ea533dde 100644
--- a/libcxx/utils/libcxx/header_information.py
+++ b/libcxx/utils/libcxx/header_information.py
@@ -19,7 +19,6 @@
# transitive includers of the above headers
"clocale": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
"codecvt": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
- "experimental/regex": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
"fstream": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
"iomanip": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
"iostream": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
@@ -56,22 +55,11 @@
"coroutine": "// UNSUPPORTED: c++03, c++11, c++14, c++17",
"cwchar": "// UNSUPPORTED: no-wide-characters",
"cwctype": "// UNSUPPORTED: no-wide-characters",
- "experimental/deque": "// UNSUPPORTED: c++03",
- "experimental/forward_list": "// UNSUPPORTED: c++03",
"experimental/iterator": "// UNSUPPORTED: c++03",
- "experimental/list": "// UNSUPPORTED: c++03",
- "experimental/map": "// UNSUPPORTED: c++03",
- "experimental/memory_resource": "// UNSUPPORTED: c++03",
"experimental/propagate_const": "// UNSUPPORTED: c++03",
- "experimental/regex": "// UNSUPPORTED: no-localization, c++03",
- "experimental/set": "// UNSUPPORTED: c++03",
"experimental/simd": "// UNSUPPORTED: c++03",
- "experimental/string": "// UNSUPPORTED: c++03",
"experimental/type_traits": "// UNSUPPORTED: c++03",
- "experimental/unordered_map": "// UNSUPPORTED: c++03",
- "experimental/unordered_set": "// UNSUPPORTED: c++03",
"experimental/utility": "// UNSUPPORTED: c++03",
- "experimental/vector": "// UNSUPPORTED: c++03",
"filesystem": "// UNSUPPORTED: no-filesystem, c++03, c++11, c++14",
"fstream": "// UNSUPPORTED: no-localization, no-filesystem",
"future": "// UNSUPPORTED: no-threads, c++03",
More information about the libcxx-commits
mailing list