[libcxx-commits] [libcxx] [libcxx][test-support] Improve thread_unsafe_shared_ptr (PR #195932)

Nikita Belenkiy via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 15 04:53:13 PDT 2026


================
@@ -393,21 +393,30 @@ namespace detail {
 template <class T>
 class thread_unsafe_shared_ptr {
 public:
-  thread_unsafe_shared_ptr() = default;
-
-  TEST_CONSTEXPR_CXX14 thread_unsafe_shared_ptr(const thread_unsafe_shared_ptr& other) : block(other.block) {
+  // as it's internal and technically not nullable, we don't care about null pointer state
+  // and don't need destructive move
+  TEST_CONSTEXPR_CXX14 thread_unsafe_shared_ptr(const thread_unsafe_shared_ptr& other) TEST_NOEXCEPT
----------------
kitsnet wrote:

It it was intentional, then why it was made for some internal member of the `limited_allocator`, and not for allocator itself? I would also prefer it to be noexcept for my fancy_pointer_allocator.

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


More information about the libcxx-commits mailing list