[libcxx-commits] [PATCH] D126210: [libcxx] Fix allocator<void>::pointer in C++20 with removed members
Ilya Biryukov via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 23 08:23:50 PDT 2022
ilya-biryukov added inline comments.
================
Comment at: libcxx/include/__memory/allocator.h:30
-#if _LIBCPP_STD_VER <= 17
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS)
template <>
----------------
philnik wrote:
> I think using `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` is misleading. This doesn't just re-enable members, but an entire class specialization. Adding something like `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION` would be the correct way IMO.
That keeps `allocator<void>::pointer` broken with `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` defined and `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION` not defined. Are we okay with that?
This specialization was there in the `REMOVED_ALLOCATOR_MEMBERS` mode before D104323 too, this change restores this behavior.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126210/new/
https://reviews.llvm.org/D126210
More information about the libcxx-commits
mailing list