[libcxx-commits] [libcxx] [libc++] Fix shared_ptr rebinding allocators to incomplete types (PR #206145)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 27 00:39:08 PDT 2026


================
@@ -410,7 +410,7 @@ class complete_type_allocator {
   TEST_CONSTEXPR_CXX20 complete_type_allocator() TEST_NOEXCEPT {}
 
   template <class U>
-  TEST_CONSTEXPR_CXX20 explicit complete_type_allocator(complete_type_allocator<U>) TEST_NOEXCEPT {}
+  TEST_CONSTEXPR_CXX20 complete_type_allocator(complete_type_allocator<U>) TEST_NOEXCEPT {}
----------------
frederick-vs-ja wrote:

It seems to me that we should restore the `explicit` here, as [[allocator.requirements]](https://eel.is/c++draft/allocator.requirements) only requires explicit construction between different `Ator<T>` and `Ator<U>`. And we should perform explicit cast in the constructor of control blocks.

https://github.com/llvm/llvm-project/pull/206145


More information about the libcxx-commits mailing list