Skip to content
2 changes: 1 addition & 1 deletion stl/inc/atomic
Original file line number Diff line number Diff line change
Expand Up @@ -2990,7 +2990,7 @@ public:
break;

default: // Unrecognized bit pattern
_CSTD abort();
_MSVC_STL_DOOM_FUNCTION("atomic shared_ptr invariant broken");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -3540,7 +3540,7 @@ _NODISCARD _FormatContext::iterator _Tuple_formatter_format(const tuple<formatte
_STD _Tuple_formatter_format_to_context(
_Underlying, _Separator, _Opening_bracket, _Closing_bracket, _Tmp_ctx, _Args...);
} else {
_CSTD abort(); // no basic_format_context object other than _Default_format_context can be created
_MSVC_STL_DOOM_FUNCTION("no basic_format_context object other than _Default_format_context can be created");
}

const int _Width = _STD _Measure_display_width<_CharT>(_Tmp_str);
Expand Down
13 changes: 7 additions & 6 deletions stl/inc/functional
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ private:
auto& _Myax = _Mypair._Get_first();
if constexpr (!is_copy_constructible_v<_Callable>) { // used exclusively for packaged_task
(void) _Myax;
_CSTD abort(); // shouldn't be called, see GH-3888
_MSVC_STL_DOOM_FUNCTION("this callable object should not be copied");
} else if constexpr (_Is_large<_Func_impl>) {
_Myalty _Rebound(_Myax);
_Alloc_construct_ptr<_Myalty> _Constructor{_Rebound};
Expand Down Expand Up @@ -808,7 +808,7 @@ private:
}
#else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv
[[noreturn]] const type_info& _Target_type() const noexcept override {
_CSTD abort(); // shouldn't be called, see GH-3888
_MSVC_STL_DOOM_FUNCTION("this callable object should not be queried for target typeid");
}
#endif // ^^^ !_HAS_STATIC_RTTI ^^^

Expand Down Expand Up @@ -859,7 +859,8 @@ public:
private:
_Mybase* _Copy(void* _Where) const override {
if constexpr (!is_copy_constructible_v<_Callable>) { // used exclusively for packaged_task
_CSTD abort(); // shouldn't be called, see GH-3888
_MSVC_STL_DOOM_FUNCTION("this callable object should not be copied");

} else if constexpr (_Is_large<_Func_impl_no_alloc>) {
return _STD _Global_new<_Func_impl_no_alloc>(_Callee);
} else {
Expand Down Expand Up @@ -889,7 +890,7 @@ private:
}
#else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv
[[noreturn]] const type_info& _Target_type() const noexcept override {
_CSTD abort(); // shouldn't be called, see GH-3888
_MSVC_STL_DOOM_FUNCTION("this callable object should not be queried for target typeid");
}
#endif // ^^^ !_HAS_STATIC_RTTI ^^^

Expand Down Expand Up @@ -1352,8 +1353,8 @@ inline constexpr size_t _Minimum_function_size = 2 * sizeof(void*);

template <class _Rx, class... _Types>
[[noreturn]] _Rx __stdcall _Function_not_callable(const _Move_only_function_data&, _Types&&...) noexcept {
_CSTD abort(); // Unlike std::function, move_only_function doesn't throw bad_function_call
// (N4950 [func.wrap.move.inv]/2)
_MSVC_STL_DOOM_FUNCTION("empty move_only_function call"); // Unlike std::function, move_only_function doesn't throw
// bad_function_call (N4950 [func.wrap.move.inv]/2)
}

template <class _Vt, class _VtInvQuals, class _Rx, bool _Noex, class... _Types>
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/future
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ template <class... _Types>
class _Fake_no_copy_callable_adapter {
// async() is built on packaged_task internals which incorrectly use
// std::function, which requires that things be copyable. We can't fix this in an
// update, so this adapter turns copies into abort(). When VSO-153581 is
// update, so this adapter turns copies into _MSVC_STL_DOOM_FUNCTION(). When VSO-153581 is
// fixed, remove this adapter.
private:
using _Storaget = tuple<decay_t<_Types>...>;
Expand All @@ -1331,7 +1331,7 @@ public:

[[noreturn]] _Fake_no_copy_callable_adapter(const _Fake_no_copy_callable_adapter& _Other)
: _Storage(_STD move(_Other._Storage)) {
_CSTD abort(); // shouldn't be called
_MSVC_STL_DOOM_FUNCTION("this callable object should not be copied"); // shouldn't be called
}

_Fake_no_copy_callable_adapter(_Fake_no_copy_callable_adapter&& _Other) = default;
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/memory
Original file line number Diff line number Diff line change
Expand Up @@ -1128,11 +1128,11 @@ private:
#ifdef _M_CEE_PURE
// permanent workaround to avoid mentioning _purecall in msvcurt.lib, ptrustu.lib, or other support libs
virtual void _Destroy() noexcept {
_CSTD abort();
_MSVC_STL_DOOM_FUNCTION("_Ref_count_base base class member functions should not be called");
}

virtual void _Delete_this() noexcept {
_CSTD abort();
_MSVC_STL_DOOM_FUNCTION("_Ref_count_base base class member functions should not be called");
}
#else // ^^^ defined(_M_CEE_PURE) / !defined(_M_CEE_PURE) vvv
virtual void _Destroy() noexcept = 0; // destroy managed resource
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/utility
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,8 @@ _NODISCARD constexpr underlying_type_t<_Ty> to_underlying(_Ty _Value) noexcept {
_EXPORT_STD [[noreturn]] __forceinline void unreachable() noexcept /* strengthened */ {
_STL_UNREACHABLE;
#ifdef _DEBUG
_CSTD abort(); // likely to be called in debug mode, but can't be relied upon - already entered the UB territory
_MSVC_STL_DOOM_FUNCTION("unreachable() called"); // likely to be called in debug mode, but no guarantee:
// already entered the UB territory
#endif // defined(_DEBUG)
}

Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xcall_once.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void(call_once)(once_flag& _Once, _Fn&& _Fx, _Args&&... _Ax)
// parentheses against common "#define call_once(flag,func) pthread_once(flag,func)"
int _Pending;
if (!_RENAME_WINDOWS_API(__std_init_once_begin_initialize)(&_Once._Opaque, 0, &_Pending, nullptr)) {
_CSTD abort();
_MSVC_STL_DOOM_FUNCTION("InitOnceBeginInitialize() failed");
}

if (_Pending != 0) {
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xlocale
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ const _Facet& __CRTDECL use_facet(const locale& _Loc) { // get facet reference f
#if _HAS_EXCEPTIONS
_Throw_bad_cast(); // lazy disallowed
#else
_CSTD abort(); // lazy disallowed
_MSVC_STL_DOOM_FUNCTION("lazy facet disallowed");
#endif
} else { // queue up lazy facet for destruction
auto _Pfmod = const_cast<locale::facet*>(_Psave);
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ struct _Projected_impl {

using value_type = remove_cvref_t<indirect_result_t<_Proj&, _It>>;
[[noreturn]] indirect_result_t<_Proj&, _It> operator*() const {
_CSTD abort(); // shouldn't be called, see GH-3888
_MSVC_STL_DOOM_FUNCTION("");
}
};
};
Expand Down