@@ -1311,7 +1311,15 @@ protected:
1311
1311
1312
1312
constexpr _Ptr_base() noexcept = default;
1313
1313
1314
+ #if _MSVC_STL_DESTRUCTOR_TOMBSTONES
1315
+ ~_Ptr_base() noexcept {
1316
+ const uintptr_t _Tombstone_value{_MSVC_STL_UINTPTR_TOMBSTONE_VALUE};
1317
+ _Ptr = reinterpret_cast<element_type*>(_Tombstone_value);
1318
+ _Rep = reinterpret_cast<_Ref_count_base*>(_Tombstone_value);
1319
+ }
1320
+ #else // ^^^ _MSVC_STL_DESTRUCTOR_TOMBSTONES / !_MSVC_STL_DESTRUCTOR_TOMBSTONES vvv
1314
1321
~_Ptr_base() = default;
1322
+ #endif // ^^^ !_MSVC_STL_DESTRUCTOR_TOMBSTONES ^^^
1315
1323
1316
1324
template <class _Ty2>
1317
1325
void _Move_construct_from(_Ptr_base<_Ty2>&& _Right) noexcept {
@@ -3418,6 +3426,15 @@ public:
3418
3426
if (_Mypair._Myval2) {
3419
3427
_Mypair._Get_first()(_Mypair._Myval2);
3420
3428
}
3429
+
3430
+ #if _MSVC_STL_DESTRUCTOR_TOMBSTONES
3431
+ if constexpr (is_pointer_v<pointer>) {
3432
+ if (!_STD _Is_constant_evaluated()) {
3433
+ const auto _Tombstone{reinterpret_cast<pointer>(_MSVC_STL_UINTPTR_TOMBSTONE_VALUE)};
3434
+ _Mypair._Myval2 = _Tombstone;
3435
+ }
3436
+ }
3437
+ #endif // _MSVC_STL_DESTRUCTOR_TOMBSTONES
3421
3438
}
3422
3439
3423
3440
_NODISCARD _CONSTEXPR23 _Dx& get_deleter() noexcept {
@@ -3555,6 +3572,15 @@ public:
3555
3572
if (_Mypair._Myval2) {
3556
3573
_Mypair._Get_first()(_Mypair._Myval2);
3557
3574
}
3575
+
3576
+ #if _MSVC_STL_DESTRUCTOR_TOMBSTONES
3577
+ if constexpr (is_pointer_v<pointer>) {
3578
+ if (!_STD _Is_constant_evaluated()) {
3579
+ const auto _Tombstone{reinterpret_cast<pointer>(_MSVC_STL_UINTPTR_TOMBSTONE_VALUE)};
3580
+ _Mypair._Myval2 = _Tombstone;
3581
+ }
3582
+ }
3583
+ #endif // _MSVC_STL_DESTRUCTOR_TOMBSTONES
3558
3584
}
3559
3585
3560
3586
_NODISCARD _CONSTEXPR23 _Dx& get_deleter() noexcept {
0 commit comments