This DR was approved at the February 2022 plenary.
libstdc++-v3/ChangeLog:
* include/bits/shared_ptr_atomic.h (atomic<shared_ptr>): Add
constructor for constant initialization from nullptr_t.
* testsuite/20_util/shared_ptr/atomic/atomic_shared_ptr.cc:
Check for new constructor.
constexpr atomic() noexcept = default;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 3661. constinit atomic<shared_ptr<T>> a(nullptr); should work
+ constexpr atomic(nullptr_t) noexcept : atomic() { }
+
atomic(shared_ptr<_Tp> __r) noexcept
: _M_impl(std::move(__r))
{ }
// Check constexpr constructor.
constinit std::atomic<std::shared_ptr<int>> a;
+// LWG 3661. constinit atomic<shared_ptr<T>> a(nullptr); should work
+constinit std::atomic<std::shared_ptr<int>> a2 = nullptr;
void
test_is_lock_free()