[libcxx-commits] [PATCH] D120996: [libc++] Remove extension to support allocator<const T>

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 4 06:57:46 PST 2022


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

This extension is a portability trap for users, since no other standard
library supports it. Furthermore, the Standard explicitly allows
implementations to reject std::allocator<cv T>, so allowing it is
really going against the current.

This was discovered in D120684 <https://reviews.llvm.org/D120684>: this extension required `const_cast`ing
in `__construct_range_forward`, a fishy bit of code that can be removed
if we don't support the extension anymore.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120996

Files:
  libcxx/docs/ReleaseNotes.rst
  libcxx/include/__memory/allocator.h
  libcxx/include/__memory/shared_ptr.h
  libcxx/include/memory
  libcxx/test/libcxx/containers/sequences/vector/const_value_type.pass.cpp
  libcxx/test/libcxx/memory/allocator.cv.verify.cpp
  libcxx/test/libcxx/memory/allocator_void.trivial.compile.pass.cpp
  libcxx/test/libcxx/memory/allocator_volatile.verify.cpp
  libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
  libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_rvalue_reference_t.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.members/allocate.constexpr.size.verify.cpp
  libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.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/specialized.algorithms/specialized.construct/construct_at.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120996.412997.patch
Type: text/x-patch
Size: 17922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220304/d80dcb2b/attachment-0001.bin>


More information about the libcxx-commits mailing list