[libcxx-commits] [PATCH] D104323: [libc++] Undeprecate the std::allocator<void> specialization

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 15 14:30:57 PDT 2021


ldionne created this revision.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

While the std::allocator<void> specialization was deprecated by
https://wg21.link/p0174#2.2, the *use* of std::allocator<void> by users
was not. The intent was that std::allocator<void> could still be used
in C++17 and C++20, but starting with C++20 (with the removal of the
specialization), std::allocator<void> would use the primary template.
That intent was called out in wg21.link/p0619r4#3.9.

As a result of this patch, _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
will also not control whether the explicit specialization is provided or
not. It shouldn't matter, since in C++20, one can simply use the primary
template.

Fixes http://llvm.org/PR50299


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104323

Files:
  libcxx/docs/UsingLibcxx.rst
  libcxx/include/__memory/allocator.h
  libcxx/include/memory
  libcxx/test/libcxx/depr/depr.default.allocator/allocator_types.cxx2a.pass.cpp
  libcxx/test/libcxx/depr/depr.default.allocator/allocator_void.cxx2a.pass.cpp
  libcxx/test/std/utilities/memory/default.allocator/PR50299.compile.pass.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator.dtor.pass.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator_pointers.pass.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator_types.void.compile.pass.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator_void.deprecated_in_cxx17.verify.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104323.352250.patch
Type: text/x-patch
Size: 20784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210615/5fb89f41/attachment-0001.bin>


More information about the libcxx-commits mailing list