[libcxx-commits] [libcxx] 2da049a - [libc++] Add incomplete availability markup for std::pmr
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 20 07:59:10 PDT 2023
Author: Louis Dionne
Date: 2023-06-20T10:59:05-04:00
New Revision: 2da049a1418f7a2f96e7cac4368cac3ce8667d2e
URL: https://github.com/llvm/llvm-project/commit/2da049a1418f7a2f96e7cac4368cac3ce8667d2e
DIFF: https://github.com/llvm/llvm-project/commit/2da049a1418f7a2f96e7cac4368cac3ce8667d2e.diff
LOG: [libc++] Add incomplete availability markup for std::pmr
This fixes rdar://110330781, which asked for the feature-test macro
for std::pmr to take into account the deployment target. It doesn't
fix https://llvm.org/PR62212, though, because the availability markup
itself must be disabled until some Clang bugs have been fixed.
This is pretty vexing, however at least everything should work once
those Clang bugs have been fixed. In the meantime, this patch at least
adds the required markup (as disabled) and ensures that the feature-test
macro for std::pmr is aware of the deployment target requirement.
Differential Revision: https://reviews.llvm.org/D135813
Added:
libcxx/test/libcxx/utilities/utility/mem.res/pmr.availability.verify.cpp
Modified:
libcxx/include/__availability
libcxx/include/__fwd/memory_resource.h
libcxx/include/__fwd/string.h
libcxx/include/__memory_resource/memory_resource.h
libcxx/include/__memory_resource/monotonic_buffer_resource.h
libcxx/include/__memory_resource/polymorphic_allocator.h
libcxx/include/__memory_resource/synchronized_pool_resource.h
libcxx/include/__memory_resource/unsynchronized_pool_resource.h
libcxx/include/deque
libcxx/include/forward_list
libcxx/include/list
libcxx/include/map
libcxx/include/regex
libcxx/include/set
libcxx/include/unordered_map
libcxx/include/unordered_set
libcxx/include/vector
libcxx/include/version
libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/assign.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/copy.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/other_alloc.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/copy_move.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/construct.fail.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/private_members.fail.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/protected_members.fail.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp
libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp
libcxx/test/std/utilities/utility/mem.res/nodiscard.verify.cpp
libcxx/utils/generate_feature_test_macro_components.py
libcxx/utils/libcxx/test/features.py
Removed:
################################################################################
diff --git a/libcxx/include/__availability b/libcxx/include/__availability
index adaf0c75a51e0..7807f22b716ff 100644
--- a/libcxx/include/__availability
+++ b/libcxx/include/__availability
@@ -169,6 +169,11 @@
// # define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT
+ // This controls the availability of the C++17 std::pmr library,
+ // which is implemented in large part in the built library.
+// # define _LIBCPP_AVAILABILITY_HAS_NO_PMR
+# define _LIBCPP_AVAILABILITY_PMR
+
#elif defined(__APPLE__)
// shared_mutex and shared_timed_mutex
@@ -322,6 +327,27 @@
# define _LIBCPP_AVAILABILITY_VERBOSE_ABORT \
__attribute__((unavailable))
+ // std::pmr
+# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 140000) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 170000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 170000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 100000)
+# define _LIBCPP_AVAILABILITY_HAS_NO_PMR
+# endif
+// TODO: Enable std::pmr markup once https://github.com/llvm/llvm-project/issues/40340 has been fixed
+// Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support
+// it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we
+// use availability annotations until that bug has been fixed.
+# if 0
+# define _LIBCPP_AVAILABILITY_PMR \
+ __attribute__((availability(macos, strict, introduced = 14.0))) \
+ __attribute__((availability(ios, strict, introduced = 17.0))) \
+ __attribute__((availability(tvos, strict, introduced = 17.0))) \
+ __attribute__((availability(watchos, strict, introduced = 10.0)))
+# else
+# define _LIBCPP_AVAILABILITY_PMR
+# endif
+
#else
// ...New vendors can add availability markup here...
diff --git a/libcxx/include/__fwd/memory_resource.h b/libcxx/include/__fwd/memory_resource.h
index 718a9078d3cfb..03b78ad2bd3c0 100644
--- a/libcxx/include/__fwd/memory_resource.h
+++ b/libcxx/include/__fwd/memory_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___FWD_MEMORY_RESOURCE_H
#define _LIBCPP___FWD_MEMORY_RESOURCE_H
+#include <__availability>
#include <__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -19,7 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueType>
-class _LIBCPP_TEMPLATE_VIS polymorphic_allocator;
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__fwd/string.h b/libcxx/include/__fwd/string.h
index 7ab5561b758f2..032132374de5e 100644
--- a/libcxx/include/__fwd/string.h
+++ b/libcxx/include/__fwd/string.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___FWD_STRING_H
#define _LIBCPP___FWD_STRING_H
+#include <__availability>
#include <__config>
#include <__fwd/memory_resource.h>
@@ -61,21 +62,20 @@ using u32string = basic_string<char32_t>;
namespace pmr {
template <class _CharT, class _Traits = char_traits<_CharT>>
-using basic_string = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
+using basic_string _LIBCPP_AVAILABILITY_PMR = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
-using string = basic_string<char>;
+using string _LIBCPP_AVAILABILITY_PMR = basic_string<char>;
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wstring = basic_string<wchar_t>;
+using wstring _LIBCPP_AVAILABILITY_PMR = basic_string<wchar_t>;
# endif
# ifndef _LIBCPP_HAS_NO_CHAR8_T
-using u8string = basic_string<char8_t>;
+using u8string _LIBCPP_AVAILABILITY_PMR = basic_string<char8_t>;
# endif
-using u16string = basic_string<char16_t>;
-using u32string = basic_string<char32_t>;
-
+using u16string _LIBCPP_AVAILABILITY_PMR = basic_string<char16_t>;
+using u32string _LIBCPP_AVAILABILITY_PMR = basic_string<char32_t>;
} // namespace pmr
#endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__memory_resource/memory_resource.h b/libcxx/include/__memory_resource/memory_resource.h
index db452a252c735..3ed5af0fd8c99 100644
--- a/libcxx/include/__memory_resource/memory_resource.h
+++ b/libcxx/include/__memory_resource/memory_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H
+#include <__availability>
#include <__config>
#include <cstddef>
@@ -24,7 +25,7 @@ namespace pmr {
// [mem.res.class]
-class _LIBCPP_EXPORTED_FROM_ABI memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource {
static const size_t __max_align = alignof(max_align_t);
public:
@@ -51,13 +52,15 @@ class _LIBCPP_EXPORTED_FROM_ABI memory_resource {
// [mem.res.eq]
-inline _LIBCPP_HIDE_FROM_ABI bool operator==(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
+inline _LIBCPP_AVAILABILITY_PMR _LIBCPP_HIDE_FROM_ABI bool
+operator==(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
return &__lhs == &__rhs || __lhs.is_equal(__rhs);
}
# if _LIBCPP_STD_VER <= 17
-inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
+inline _LIBCPP_AVAILABILITY_PMR _LIBCPP_HIDE_FROM_ABI bool
+operator!=(const memory_resource& __lhs, const memory_resource& __rhs) noexcept {
return !(__lhs == __rhs);
}
@@ -65,15 +68,16 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const memory_resource& __lhs, const
// [mem.res.global]
-[[__gnu__::__returns_nonnull__]] _LIBCPP_EXPORTED_FROM_ABI memory_resource* get_default_resource() noexcept;
+[[__gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+get_default_resource() noexcept;
-[[__gnu__::__returns_nonnull__]] _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+[[__gnu__::__returns_nonnull__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
set_default_resource(memory_resource*) noexcept;
-[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
new_delete_resource() noexcept;
-[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_EXPORTED_FROM_ABI memory_resource*
+[[using __gnu__: __returns_nonnull__, __const__]] _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI memory_resource*
null_memory_resource() noexcept;
} // namespace pmr
diff --git a/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
index 0a0565048ef60..0c83f1ebc8db4 100644
--- a/libcxx/include/__memory_resource/monotonic_buffer_resource.h
+++ b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H
+#include <__availability>
#include <__config>
#include <__memory/addressof.h>
#include <__memory_resource/memory_resource.h>
@@ -26,7 +27,7 @@ namespace pmr {
// [mem.res.monotonic.buffer]
-class _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resource : public memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resource : public memory_resource {
static const size_t __default_buffer_capacity = 1024;
static const size_t __default_buffer_alignment = 16;
diff --git a/libcxx/include/__memory_resource/polymorphic_allocator.h b/libcxx/include/__memory_resource/polymorphic_allocator.h
index 57558f0d3d6cf..77a2847dbcb1a 100644
--- a/libcxx/include/__memory_resource/polymorphic_allocator.h
+++ b/libcxx/include/__memory_resource/polymorphic_allocator.h
@@ -10,6 +10,7 @@
#define _LIBCPP___MEMORY_RESOURCE_POLYMORPHIC_ALLOCATOR_H
#include <__assert>
+#include <__availability>
#include <__config>
#include <__memory_resource/memory_resource.h>
#include <__utility/exception_guard.h>
@@ -39,7 +40,7 @@ template <class _ValueType
= byte
# endif
>
-class _LIBCPP_TEMPLATE_VIS polymorphic_allocator {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator {
public:
using value_type = _ValueType;
diff --git a/libcxx/include/__memory_resource/synchronized_pool_resource.h b/libcxx/include/__memory_resource/synchronized_pool_resource.h
index c780164c41760..b261fb0b194a8 100644
--- a/libcxx/include/__memory_resource/synchronized_pool_resource.h
+++ b/libcxx/include/__memory_resource/synchronized_pool_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H
+#include <__availability>
#include <__config>
#include <__memory_resource/memory_resource.h>
#include <__memory_resource/pool_options.h>
@@ -28,7 +29,7 @@ namespace pmr {
// [mem.res.pool.overview]
-class _LIBCPP_EXPORTED_FROM_ABI synchronized_pool_resource : public memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI synchronized_pool_resource : public memory_resource {
public:
_LIBCPP_HIDE_FROM_ABI synchronized_pool_resource(const pool_options& __opts, memory_resource* __upstream)
: __unsync_(__opts, __upstream) {}
diff --git a/libcxx/include/__memory_resource/unsynchronized_pool_resource.h b/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
index fcb2f2403ba65..81d5f9ec4da87 100644
--- a/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
+++ b/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
@@ -9,6 +9,7 @@
#ifndef _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
#define _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H
+#include <__availability>
#include <__config>
#include <__memory_resource/memory_resource.h>
#include <__memory_resource/pool_options.h>
@@ -27,7 +28,7 @@ namespace pmr {
// [mem.res.pool.overview]
-class _LIBCPP_EXPORTED_FROM_ABI unsynchronized_pool_resource : public memory_resource {
+class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI unsynchronized_pool_resource : public memory_resource {
class __fixed_pool;
class __adhoc_pool {
diff --git a/libcxx/include/deque b/libcxx/include/deque
index 175e56e0f9de8..ad126f65d96bb 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -189,6 +189,7 @@ template <class T, class Allocator, class Predicate>
#include <__algorithm/remove_if.h>
#include <__algorithm/unwrap_iter.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__format/enable_insertable.h>
#include <__iterator/distance.h>
@@ -2652,7 +2653,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using deque = std::deque<_ValueT, polymorphic_allocator<_ValueT>>;
+using deque _LIBCPP_AVAILABILITY_PMR = std::deque<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 10c9c15767bdb..41829636a2a2b 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -188,6 +188,7 @@ template <class T, class Allocator, class Predicate>
#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__iterator/distance.h>
#include <__iterator/iterator_traits.h>
@@ -1814,7 +1815,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using forward_list = std::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
+using forward_list _LIBCPP_AVAILABILITY_PMR = std::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
diff --git a/libcxx/include/list b/libcxx/include/list
index a762b6b3b84de..0ba7475ef32cb 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -189,6 +189,7 @@ template <class T, class Allocator, class Predicate>
#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__debug>
#include <__format/enable_insertable.h>
@@ -2391,7 +2392,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using list = std::list<_ValueT, polymorphic_allocator<_ValueT>>;
+using list _LIBCPP_AVAILABILITY_PMR = std::list<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
diff --git a/libcxx/include/map b/libcxx/include/map
index eb7c204ac3b22..6fb1d22570b41 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -542,6 +542,7 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
#include <__algorithm/lexicographical_compare.h>
#include <__algorithm/lexicographical_compare_three_way.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__functional/binary_function.h>
#include <__functional/is_transparent.h>
@@ -2389,10 +2390,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _ValueT, class _CompareT = std::less<_KeyT>>
-using map = std::map<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
+using map _LIBCPP_AVAILABILITY_PMR = std::map<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
template <class _KeyT, class _ValueT, class _CompareT = std::less<_KeyT>>
-using multimap = std::multimap<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
+using multimap _LIBCPP_AVAILABILITY_PMR = std::multimap<_KeyT, _ValueT, _CompareT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
diff --git a/libcxx/include/regex b/libcxx/include/regex
index ea2711fddafca..dce58c769de52 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -788,6 +788,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <__algorithm/find.h>
#include <__algorithm/search.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__iterator/back_insert_iterator.h>
#include <__iterator/wrap_iter.h>
@@ -6923,14 +6924,14 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _BidirT>
-using match_results = std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
+using match_results _LIBCPP_AVAILABILITY_PMR = std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
-using cmatch = match_results<const char*>;
-using smatch = match_results<std::pmr::string::const_iterator>;
+using cmatch _LIBCPP_AVAILABILITY_PMR = match_results<const char*>;
+using smatch _LIBCPP_AVAILABILITY_PMR = match_results<std::pmr::string::const_iterator>;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-using wcmatch = match_results<const wchar_t*>;
-using wsmatch = match_results<std::pmr::wstring::const_iterator>;
+using wcmatch _LIBCPP_AVAILABILITY_PMR = match_results<const wchar_t*>;
+using wsmatch _LIBCPP_AVAILABILITY_PMR = match_results<std::pmr::wstring::const_iterator>;
#endif
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/set b/libcxx/include/set
index 7d54c9022a8b6..49b351304506e 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -483,6 +483,7 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
#include <__algorithm/lexicographical_compare.h>
#include <__algorithm/lexicographical_compare_three_way.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
@@ -1623,10 +1624,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _CompareT = std::less<_KeyT>>
-using set = std::set<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
+using set _LIBCPP_AVAILABILITY_PMR = std::set<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
template <class _KeyT, class _CompareT = std::less<_KeyT>>
-using multiset = std::multiset<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
+using multiset _LIBCPP_AVAILABILITY_PMR = std::multiset<_KeyT, _CompareT, polymorphic_allocator<_KeyT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index d0168a01065e6..a162dea0767ab 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -516,6 +516,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <__algorithm/is_permutation.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__debug>
#include <__functional/is_transparent.h>
@@ -2646,11 +2647,11 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _ValueT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_map =
+using unordered_map _LIBCPP_AVAILABILITY_PMR =
std::unordered_map<_KeyT, _ValueT, _HashT, _PredT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
template <class _KeyT, class _ValueT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_multimap =
+using unordered_multimap _LIBCPP_AVAILABILITY_PMR =
std::unordered_multimap<_KeyT, _ValueT, _HashT, _PredT, polymorphic_allocator<std::pair<const _KeyT, _ValueT>>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index 020689d7cf1d9..21fb8d7bdfede 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -461,6 +461,7 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <__algorithm/is_permutation.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__config>
#include <__debug>
#include <__functional/is_transparent.h>
@@ -1815,10 +1816,10 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _KeyT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_set = std::unordered_set<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
+using unordered_set _LIBCPP_AVAILABILITY_PMR = std::unordered_set<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
template <class _KeyT, class _HashT = std::hash<_KeyT>, class _PredT = std::equal_to<_KeyT>>
-using unordered_multiset = std::unordered_multiset<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
+using unordered_multiset _LIBCPP_AVAILABILITY_PMR = std::unordered_multiset<_KeyT, _HashT, _PredT, polymorphic_allocator<_KeyT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
diff --git a/libcxx/include/vector b/libcxx/include/vector
index 33db49a099d40..d636dd68e6ab3 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -312,6 +312,7 @@ template<class T, class charT> requires is-vector-bool-reference<T> // Since C++
#include <__algorithm/rotate.h>
#include <__algorithm/unwrap_iter.h>
#include <__assert> // all public C++ headers provide the assertion handler
+#include <__availability>
#include <__bit_reference>
#include <__concepts/same_as.h>
#include <__config>
@@ -3563,7 +3564,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_BEGIN_NAMESPACE_STD
namespace pmr {
template <class _ValueT>
-using vector = std::vector<_ValueT, polymorphic_allocator<_ValueT>>;
+using vector _LIBCPP_AVAILABILITY_PMR = std::vector<_ValueT, polymorphic_allocator<_ValueT>>;
} // namespace pmr
_LIBCPP_END_NAMESPACE_STD
#endif
diff --git a/libcxx/include/version b/libcxx/include/version
index 0cdf06d6d370c..ac932062aacf9 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -289,7 +289,9 @@ __cpp_lib_within_lifetime 202306L <type_traits>
# define __cpp_lib_make_from_tuple 201606L
# define __cpp_lib_map_try_emplace 201411L
// # define __cpp_lib_math_special_functions 201603L
-# define __cpp_lib_memory_resource 201603L
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# define __cpp_lib_memory_resource 201603L
+# endif
# define __cpp_lib_node_extract 201606L
# define __cpp_lib_nonmember_container_access 201411L
# define __cpp_lib_not_fn 201603L
@@ -376,7 +378,9 @@ __cpp_lib_within_lifetime 202306L <type_traits>
# define __cpp_lib_list_remove_return_type 201806L
# define __cpp_lib_math_constants 201907L
# define __cpp_lib_move_iterator_concept 202207L
-# define __cpp_lib_polymorphic_allocator 201902L
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# define __cpp_lib_polymorphic_allocator 201902L
+# endif
# define __cpp_lib_ranges 202106L
# define __cpp_lib_remove_cvref 201711L
# if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(_LIBCPP_AVAILABILITY_HAS_NO_SYNC)
diff --git a/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp b/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
index 3d260bae06feb..916f9c31d4e90 100644
--- a/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp b/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
index ffebab027009c..a01cdce053905 100644
--- a/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp b/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
index dba79a27c9d17..29e9d0345c14f 100644
--- a/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp b/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp
index c1d612e17540c..3226efcec1b23 100644
--- a/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp
+++ b/libcxx/test/libcxx/utilities/utility/mem.res/mem.res.pool/unsynchronized_buffer.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/libcxx/utilities/utility/mem.res/pmr.availability.verify.cpp b/libcxx/test/libcxx/utilities/utility/mem.res/pmr.availability.verify.cpp
new file mode 100644
index 0000000000000..34cf178b7a229
--- /dev/null
+++ b/libcxx/test/libcxx/utilities/utility/mem.res/pmr.availability.verify.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, c++11, c++14
+// REQUIRES: availability-pmr-missing
+
+// TODO: This test doesn't work until https://github.com/llvm/llvm-project/issues/40340
+// has been fixed, because we actually disable availability markup.
+// XFAIL: *
+
+// Test the availability markup on std::pmr components.
+
+#include <deque>
+#include <forward_list>
+#include <list>
+#include <map>
+#include <memory_resource>
+#include <regex>
+#include <set>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+
+void f() {
+ [[maybe_unused]] std::pmr::match_results<const char8_t*> m1; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::cmatch m2; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::wcmatch m3; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::smatch m4; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::wsmatch m5; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::deque<int> m6; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::forward_list<int> m7; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::list<int> m8; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::map<int, int> m9; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::multimap<int, int> m10; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::set<int> m11; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::multiset<int> m12; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::string m13; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::wstring m14; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::u8string m15; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::u16string m16; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::u32string m17; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::basic_string<char8_t> m18; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::unordered_map<int, int> m19; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::unordered_multimap<int, int> m20; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::unordered_set<int, int> m21; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::unordered_multiset<int, int> m22; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::vector<int> m23; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::polymorphic_allocator<int> poly; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::memory_resource* res = nullptr; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::synchronized_pool_resource r1; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::monotonic_buffer_resource r2; // expected-error {{is unavailable}}
+ [[maybe_unused]] std::pmr::unsynchronized_pool_resource r3; // expected-error {{is unavailable}}
+ (void)std::pmr::get_default_resource(); // expected-error {{is unavailable}}
+ (void)std::pmr::set_default_resource(nullptr); // expected-error {{is unavailable}}
+ (void)std::pmr::new_delete_resource(); // expected-error {{is unavailable}}
+ (void)std::pmr::null_memory_resource(); // expected-error {{is unavailable}}
+ (void)(*res == *res); // expected-error {{is unavailable}}
+}
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
index f4c9b3d257958..cb2fc8cb318b4 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.compile.pass.cpp
@@ -45,11 +45,17 @@
#elif TEST_STD_VER == 17
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++17"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++17"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++17"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++17"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifdef __cpp_lib_polymorphic_allocator
@@ -58,50 +64,86 @@
#elif TEST_STD_VER == 20
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++20"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++20"
-# endif
-
-# ifndef __cpp_lib_polymorphic_allocator
-# error "__cpp_lib_polymorphic_allocator should be defined in c++20"
-# endif
-# if __cpp_lib_polymorphic_allocator != 201902L
-# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++20"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++20"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++20"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
#elif TEST_STD_VER == 23
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++23"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++23"
-# endif
-
-# ifndef __cpp_lib_polymorphic_allocator
-# error "__cpp_lib_polymorphic_allocator should be defined in c++23"
-# endif
-# if __cpp_lib_polymorphic_allocator != 201902L
-# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++23"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++23"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++23"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
#elif TEST_STD_VER > 23
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++26"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++26"
-# endif
-
-# ifndef __cpp_lib_polymorphic_allocator
-# error "__cpp_lib_polymorphic_allocator should be defined in c++26"
-# endif
-# if __cpp_lib_polymorphic_allocator != 201902L
-# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++26"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++26"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
+# endif
+
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++26"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
#endif // TEST_STD_VER > 23
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index 040dc9c6cd9e7..06301620781f7 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -2265,11 +2265,17 @@
# error "__cpp_lib_mdspan should not be defined before c++23"
# endif
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++17"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++17"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++17"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++17"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifdef __cpp_lib_move_iterator_concept
@@ -3435,11 +3441,17 @@
# error "__cpp_lib_mdspan should not be defined before c++23"
# endif
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++20"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++20"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++20"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++20"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifndef __cpp_lib_move_iterator_concept
@@ -3505,11 +3517,17 @@
# endif
# endif
-# ifndef __cpp_lib_polymorphic_allocator
-# error "__cpp_lib_polymorphic_allocator should be defined in c++20"
-# endif
-# if __cpp_lib_polymorphic_allocator != 201902L
-# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++20"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifndef __cpp_lib_quoted_string_io
@@ -4764,11 +4782,17 @@
# endif
# endif
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++23"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++23"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++23"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++23"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifndef __cpp_lib_move_iterator_concept
@@ -4852,11 +4876,17 @@
# endif
# endif
-# ifndef __cpp_lib_polymorphic_allocator
-# error "__cpp_lib_polymorphic_allocator should be defined in c++23"
-# endif
-# if __cpp_lib_polymorphic_allocator != 201902L
-# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++23"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifndef __cpp_lib_quoted_string_io
@@ -6291,11 +6321,17 @@
# endif
# endif
-# ifndef __cpp_lib_memory_resource
-# error "__cpp_lib_memory_resource should be defined in c++26"
-# endif
-# if __cpp_lib_memory_resource != 201603L
-# error "__cpp_lib_memory_resource should have the value 201603L in c++26"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should be defined in c++26"
+# endif
+# if __cpp_lib_memory_resource != 201603L
+# error "__cpp_lib_memory_resource should have the value 201603L in c++26"
+# endif
+# else
+# ifdef __cpp_lib_memory_resource
+# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifndef __cpp_lib_move_iterator_concept
@@ -6379,11 +6415,17 @@
# endif
# endif
-# ifndef __cpp_lib_polymorphic_allocator
-# error "__cpp_lib_polymorphic_allocator should be defined in c++26"
-# endif
-# if __cpp_lib_polymorphic_allocator != 201902L
-# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
+# if !defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)
+# ifndef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should be defined in c++26"
+# endif
+# if __cpp_lib_polymorphic_allocator != 201902L
+# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26"
+# endif
+# else
+# ifdef __cpp_lib_polymorphic_allocator
+# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)' is not met!"
+# endif
# endif
# ifndef __cpp_lib_quoted_string_io
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/assign.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/assign.pass.cpp
index 79777940038e5..faa832815f7e6 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/assign.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/assign.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/copy.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/copy.pass.cpp
index 2d1b4296cb607..ed7e4299b50a1 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/copy.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/copy.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp
index df1f2702e1052..e4000a1c15e14 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/default.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp
index fd6970630c868..886d9dd39a1ce 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/memory_resource_convert.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/other_alloc.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/other_alloc.pass.cpp
index 93df604df9d0d..5c36f5a993ae1 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/other_alloc.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.ctor/other_alloc.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp
index 2a99883390e23..a77ed6fbdaec7 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/equal.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp
index 6f10c60830d0d..78e6b70a1aadc 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.eq/not_equal.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
index f6063b053810a..b050c8e335f1f 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
index 4bddd56b27cdd..cc7882460f018 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_bytes.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
index ddf6541ec60ac..e9da1ace79425 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/allocate_deallocate_object.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
index eafbc46605e54..da978151a4118 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
index ed2f541c12930..4cb0151ea9239 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp
index a8ac09c7d35c2..bb589b525f7fe 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_rvalue.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp
index e8a3c6294f5ec..f84fac9b5a462 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair_values.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
index d75a94aed874c..4f23dfa9e7f6e 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp
index 88e16323f3d41..701381fde5adb 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_piecewise_pair_evil.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp
index 15c46296334a3..38b004dc4eb67 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_types.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
index 3ad5d449f9a8b..67a6aa18a35c8 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/deallocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp
index 0c2605bf1f3d2..5bf50f8895405 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/destroy.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
index c4fcca15b4510..b3a79eb2b4040 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/new_delete_object.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp
index dc5f6ef053d46..23865f67a694b 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/resource.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp
index b3aa171222c89..58d6cccd244cf 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/select_on_container_copy_construction.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp
index c7f4946f212d5..af3b621856219 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <deque>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp
index 8eacb29ec2027..80e958d43a73b 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_deque_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <deque>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp
index 7947ec473f0f3..8c1372eb497f0 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_forward_list_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <forward_list>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp
index 32a583809bb41..a56c69055cc09 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <list>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp
index 069cb44b468d7..8a59e9c1ee76e 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_list_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <list>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp
index 2633c8fd6e665..6b80432f65cd9 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <map>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp
index 07a221929791d..5229805ee931f 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_map_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <map>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp
index b2284ef5b339a..a86db6b1e3fda 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_regex_synop.pass.cpp
@@ -8,7 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-localization
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <regex>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp
index ec0db982bda6c..99ded7c35b7ad 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <set>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp
index 7dae37c0c0930..ce97e178e9bbd 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_set_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <set>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp
index 71f4de8a8dc0e..751994f91ab89 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <string>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp
index 22c43692e442c..d27ca9ea7ab9d 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_string_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <string>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp
index b0dab6ea40ff8..957c5063c8e82 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <unordered_map>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp
index 2fd284f330eb6..df9dd55de020e 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_map_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <unordered_map>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp
index 3f7070940e6e5..273cffd8a6473 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <unordered_set>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp
index a8f0c48d2313e..510297d723162 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_unordered_set_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <unordered_set>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp
index df7543d70ae1b..121e2bb73443d 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <vector>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp
index 037a25b66e0cd..c6126c60dcb0b 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.aliases/header_vector_synop2.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <vector>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp
index 66f23b5063726..26981871c670f 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/default_resource.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
index 898cbf093096e..68a82f6ce90b3 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/new_delete_resource.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
index aa2be02c9b180..fc8a9e455a4bf 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.global/null_memory_resource.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/copy_move.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/copy_move.pass.cpp
index 053bd692efcfd..8adf6ca9378be 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/copy_move.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/copy_move.pass.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp
index 463b0ee8787e6..d45a0bcde8a63 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/with_default_resource.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp
index f1c75e648c9bb..1d681386987a1 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.ctor/without_buffer.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp
index f7312fe3995ee..bf025999ea61a 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_deallocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
index 9ef6275d86ce8..90ee12186650b 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_exception_safety.pass.cpp
@@ -8,7 +8,8 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: no-exceptions
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
index 549b4873d3bf2..918c81033fa3e 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
index 6d2760bc6ba7c..e0fb1c463aa24 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
index dbac78d719147..7892b182297ea 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
index 6e894a414070e..cf3dfe21d9675 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
index 8adc667cfd2a1..73a8a571179db 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_with_initial_size.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
index cae25454e6368..0637a43a6b990 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/equality.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp
index fad096dc9a632..23fd311baecf7 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/ctor_does_not_allocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp
index 9cb5de8fa0f49..caca759d2ed93 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/sync_with_default_resource.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp
index a314f5f30206d..4d23a05e5feae 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.ctor/unsync_with_default_resource.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
index 5ef7e3de2b0de..b3988572d8912 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/equality.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp
index 2e0dbf1e4b087..9f5edf28c6122 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
index 08b8be430b0dd..35a6a8f135a40 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_overaligned_request.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
index f52f07c5257f6..9327ef3859a74 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_allocate_reuse_blocks.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
index 3742c375f22c2..d5b3b6e08a42a 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/sync_deallocate_matches_allocate.pass.cpp
@@ -8,7 +8,8 @@
// UNSUPPORTED: no-exceptions
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
index 730fb09b298b9..838658d5536b6 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
index c4b501c32c10c..cd8d8a7745925 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_overaligned_request.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
index cb6fc184718b9..582bc6edc4e06 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_allocate_reuse_blocks.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
index 5cbe3a4249845..fe5f4736a7b1a 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res.pool/mem.res.pool.mem/unsync_deallocate_matches_allocate.pass.cpp
@@ -8,7 +8,8 @@
// UNSUPPORTED: no-exceptions
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/construct.fail.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/construct.fail.cpp
index acea9615275c3..8889f8d56fb1b 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/construct.fail.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/construct.fail.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp
index 9d60e35b1d95b..4fa05c6569429 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/equal.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp
index c8b9f1c6a36fd..4a10c759afa17 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.eq/not_equal.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/private_members.fail.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/private_members.fail.cpp
index f17c8132059b8..205476cb8bdd7 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/private_members.fail.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/private_members.fail.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/protected_members.fail.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/protected_members.fail.cpp
index bfd60239c9591..1a503a918d4e9 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/protected_members.fail.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.private/protected_members.fail.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// <memory_resource>
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp
index 6008bafb881ad..9c8f9fb9c9a7e 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/allocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp
index f9ffa9074b27a..e24f90a298b62 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/deallocate.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp
index 0dd35f540f3c9..35ea2e4e87225 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/dtor.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp
index 7034ceb7a7646..5bebb7f028a20 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.res/mem.res.public/is_equal.pass.cpp
@@ -7,7 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: availability-pmr-missing
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// test_memory_resource requires RTTI for dynamic_cast
// UNSUPPORTED: no-rtti
diff --git a/libcxx/test/std/utilities/utility/mem.res/nodiscard.verify.cpp b/libcxx/test/std/utilities/utility/mem.res/nodiscard.verify.cpp
index 8adfa03ed034b..f10616694a54f 100644
--- a/libcxx/test/std/utilities/utility/mem.res/nodiscard.verify.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/nodiscard.verify.cpp
@@ -7,6 +7,8 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
+// TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
+// UNSUPPORTED: availability-pmr-missing
// check that functions are marked [[nodiscard]]
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 4b835791aee53..c30fb334dd0b4 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -697,6 +697,8 @@ def add_version_header(tc):
"name": "__cpp_lib_memory_resource",
"values": {"c++17": 201603},
"headers": ["memory_resource"],
+ "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)",
+ "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)",
},
{
"name": "__cpp_lib_move_iterator_concept",
@@ -766,6 +768,8 @@ def add_version_header(tc):
"name": "__cpp_lib_polymorphic_allocator",
"values": {"c++20": 201902},
"headers": ["memory_resource"],
+ "test_suite_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)",
+ "libcxx_guard": "!defined(_LIBCPP_AVAILABILITY_HAS_NO_PMR)",
},
{
"name": "__cpp_lib_quoted_string_io",
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 26ffb16262cf7..2181cdb6ebbc2 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -522,7 +522,7 @@ def check_gdb(cfg):
Feature(
name="availability-pmr-missing",
when=lambda cfg: BooleanExpression.evaluate(
- "stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0)(.0)?}}",
+ "stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
cfg.available_features,
),
),
More information about the libcxx-commits
mailing list