File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
tests/std/tests/P0718R2_atomic_smart_ptrs Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3953,6 +3953,8 @@ public:
3953
3953
3954
3954
constexpr atomic() noexcept = default;
3955
3955
3956
+ constexpr atomic(nullptr_t) noexcept : atomic() {}
3957
+
3956
3958
atomic(const shared_ptr<_Ty> _Value) noexcept : _Base(_Value._Ptr, _Value._Rep) {
3957
3959
_Value._Incref();
3958
3960
}
Original file line number Diff line number Diff line change @@ -222,6 +222,12 @@ void ensure_nonmember_calls_compile() {
222
222
}
223
223
}
224
224
225
+ #ifndef __EDG__ // TRANSITION, DevCom-1656924
226
+ // LWG-3661: constinit atomic<shared_ptr<T>> a(nullptr); should work
227
+ constinit atomic<shared_ptr<bool >> a{};
228
+ constinit atomic<shared_ptr<bool >> b{nullptr };
229
+ #endif // __EDG__
230
+
225
231
int main () {
226
232
// These values for is_always_lock_free are not required by the standard, but they are true for our implementation.
227
233
static_assert (atomic<shared_ptr<int >>::is_always_lock_free == false );
You can’t perform that action at this time.
0 commit comments