[all-commits] [llvm/llvm-project] bed324: [libc++] Remove extension to support allocator<con...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Mon Mar 7 12:37:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bed3240bf7d196a17cc31f1c5b59b4721017e638
      https://github.com/llvm/llvm-project/commit/bed3240bf7d196a17cc31f1c5b59b4721017e638
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M libcxx/docs/ReleaseNotes.rst
    M libcxx/include/__memory/allocator.h
    M libcxx/include/__memory/shared_ptr.h
    M libcxx/include/memory
    R libcxx/test/libcxx/containers/sequences/vector/const_value_type.pass.cpp
    A libcxx/test/libcxx/memory/allocator.cv.verify.cpp
    M libcxx/test/libcxx/memory/allocator_void.trivial.compile.pass.cpp
    R libcxx/test/libcxx/memory/allocator_volatile.verify.cpp
    M libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator.ctor.pass.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator.dtor.pass.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator_types.deprecated_in_cxx17.verify.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator_types.removed_in_cxx20.verify.cpp
    M libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp

  Log Message:
  -----------
  [libc++] Remove extension to support allocator<const T>

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: 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.

Differential Revision: https://reviews.llvm.org/D120996


  Commit: ebde6fc23bc0ee9d022fcd26b52bc82dfb7c8468
      https://github.com/llvm/llvm-project/commit/ebde6fc23bc0ee9d022fcd26b52bc82dfb7c8468
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M libcxx/docs/ReleaseNotes.rst
    M libcxxabi/CMakeLists.txt

  Log Message:
  -----------
  [libcxxabi] Fix cmake order dependency wrt dllexporting

If LIBCXX_ENABLE_SHARED isn't explicitly set on the cmake command
line, isn't set in the cache, and the libcxxabi project is configured
before libcxx, then LIBCXX_ENABLE_SHARED isn't defined yet. Once
the libcxx cmake project has been parsed, LIBCXX_ENABLE_SHARED would
have been set to its default value of ON.

This makes sure that the symbols are properly dllexported in such
a configuration scenario.

Differential Revision: https://reviews.llvm.org/D120982


Compare: https://github.com/llvm/llvm-project/compare/932f628121d8...ebde6fc23bc0


More information about the All-commits mailing list