aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-12-10 14:35:07 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2024-12-10 18:07:03 +0000
commitb26d92f4f71594206385d6f645ff626c0bf9b59c (patch)
treefd1fef3bea5be2c80a72da134e6ea2a464e811c9
parent6fc3da8fa2af1d4ee154ea803636eabde358b553 (diff)
downloadgcc-b26d92f4f71594206385d6f645ff626c0bf9b59c.zip
gcc-b26d92f4f71594206385d6f645ff626c0bf9b59c.tar.gz
gcc-b26d92f4f71594206385d6f645ff626c0bf9b59c.tar.bz2
libstdc++: Use feature test macro for pmr::polymorphic_allocator<>
Check the __glibcxx_polymorphic_allocator macro instead of just checking whether __cplusplus > 201703L. libstdc++-v3/ChangeLog: * include/bits/memory_resource.h (polymoprhic_allocator): Use feature test macro for P0339R6 features.
-rw-r--r--libstdc++-v3/include/bits/memory_resource.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libstdc++-v3/include/bits/memory_resource.h b/libstdc++-v3/include/bits/memory_resource.h
index a40c972..efcb1bd 100644
--- a/libstdc++-v3/include/bits/memory_resource.h
+++ b/libstdc++-v3/include/bits/memory_resource.h
@@ -170,7 +170,7 @@ namespace pmr
__attribute__((__nonnull__))
{ _M_resource->deallocate(__p, __n * sizeof(_Tp), alignof(_Tp)); }
-#if __cplusplus > 201703L
+#ifdef __glibcxx_polymorphic_allocator // >= C++20
[[nodiscard]] void*
allocate_bytes(size_t __nbytes,
size_t __alignment = alignof(max_align_t))
@@ -220,9 +220,9 @@ namespace pmr
__p->~_Up();
deallocate_object(__p);
}
-#endif // C++2a
+#endif // C++20
-#if ! __glibcxx_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator // >= C++20
template<typename _Tp1, typename... _Args>
__attribute__((__nonnull__))
typename __not_pair<_Tp1>::type
@@ -338,7 +338,7 @@ namespace pmr
#endif
private:
-#if ! __glibcxx_make_obj_using_allocator
+#if ! __glibcxx_make_obj_using_allocator // >= C++20
using __uses_alloc1_ = __uses_alloc1<polymorphic_allocator>;
using __uses_alloc2_ = __uses_alloc2<polymorphic_allocator>;