[libcxx-commits] [PATCH] D126210: [libcxx] Fix allocator<void>::pointer in C++20 with removed members
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 23 08:31:13 PDT 2022
philnik 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 <>
----------------
ilya-biryukov wrote:
> 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.
I think it's Ok to have two flags for this, since the two changes are orthogonal IMO. But let's see what @ldionne thinks.
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