From b42fa9662be000bef7172df2d65c7898fe743d90 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 31 May 2025 15:28:39 +0300 Subject: [PATCH 01/11] Use _MSVC_STL_DOOM_FUNCTION in headers --- stl/inc/atomic | 2 +- stl/inc/format | 2 +- stl/inc/functional | 13 +++++++------ stl/inc/future | 4 ++-- stl/inc/memory | 4 ++-- stl/inc/utility | 3 ++- stl/inc/xcall_once.h | 2 +- stl/inc/xlocale | 2 +- stl/inc/xutility | 2 +- 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/stl/inc/atomic b/stl/inc/atomic index 75e45dde4a0..24d8f82b46f 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -2990,7 +2990,7 @@ public: break; default: // Unrecognized bit pattern - _CSTD abort(); + _MSVC_STL_DOOM_FUNCTION("atomic shared_ptr invariant broken"); } } } diff --git a/stl/inc/format b/stl/inc/format index 2d81e60ce56..89f2ba974e6 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -3540,7 +3540,7 @@ _NODISCARD _FormatContext::iterator _Tuple_formatter_format(const tuple(_Tmp_str); diff --git a/stl/inc/functional b/stl/inc/functional index 21c0e80ccc7..ebdd6856efa 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -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}; @@ -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 ^^^ @@ -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 { @@ -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 ^^^ @@ -1352,8 +1353,8 @@ inline constexpr size_t _Minimum_function_size = 2 * sizeof(void*); template [[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 diff --git a/stl/inc/future b/stl/inc/future index 135fa8fecdd..6e9fe154de7 100644 --- a/stl/inc/future +++ b/stl/inc/future @@ -1319,7 +1319,7 @@ template 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...>; @@ -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; diff --git a/stl/inc/memory b/stl/inc/memory index e959623f7b4..967ce2669e2 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -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 diff --git a/stl/inc/utility b/stl/inc/utility index 4570a7bb790..57b64254316 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -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) } diff --git a/stl/inc/xcall_once.h b/stl/inc/xcall_once.h index 7d484899160..81dbb819b96 100644 --- a/stl/inc/xcall_once.h +++ b/stl/inc/xcall_once.h @@ -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) { diff --git a/stl/inc/xlocale b/stl/inc/xlocale index 77c8d1b4c9b..fc2db6c68af 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -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(_Psave); diff --git a/stl/inc/xutility b/stl/inc/xutility index 46c9bef18b1..c53c928a27b 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1121,7 +1121,7 @@ struct _Projected_impl { using value_type = remove_cvref_t>; [[noreturn]] indirect_result_t<_Proj&, _It> operator*() const { - _CSTD abort(); // shouldn't be called, see GH-3888 + _MSVC_STL_DOOM_FUNCTION(""); } }; }; From 09b5a3c5449833bf8e5433b22a01cbc78046f65c Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 31 May 2025 15:33:46 +0300 Subject: [PATCH 02/11] better words --- stl/inc/functional | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stl/inc/functional b/stl/inc/functional index ebdd6856efa..00b804385bd 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -808,7 +808,7 @@ private: } #else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv [[noreturn]] const type_info& _Target_type() const noexcept override { - _MSVC_STL_DOOM_FUNCTION("this callable object should not be queried for target typeid"); + _MSVC_STL_DOOM_FUNCTION("type info is disabled"); } #endif // ^^^ !_HAS_STATIC_RTTI ^^^ @@ -860,7 +860,6 @@ private: _Mybase* _Copy(void* _Where) const override { if constexpr (!is_copy_constructible_v<_Callable>) { // used exclusively for packaged_task _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 { @@ -890,7 +889,7 @@ private: } #else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv [[noreturn]] const type_info& _Target_type() const noexcept override { - _MSVC_STL_DOOM_FUNCTION("this callable object should not be queried for target typeid"); + _MSVC_STL_DOOM_FUNCTION("type info is disabled"); } #endif // ^^^ !_HAS_STATIC_RTTI ^^^ From 817de3efef3e5be452f754e58e8210e73a68146e Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 31 May 2025 16:05:41 +0300 Subject: [PATCH 03/11] Core header! --- stl/inc/utility | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stl/inc/utility b/stl/inc/utility index 57b64254316..326b5f8978b 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -958,10 +958,6 @@ _NODISCARD constexpr underlying_type_t<_Ty> to_underlying(_Ty _Value) noexcept { _EXPORT_STD [[noreturn]] __forceinline void unreachable() noexcept /* strengthened */ { _STL_UNREACHABLE; -#ifdef _DEBUG - _MSVC_STL_DOOM_FUNCTION("unreachable() called"); // likely to be called in debug mode, but no guarantee: - // already entered the UB territory -#endif // defined(_DEBUG) } template Date: Sat, 31 May 2025 16:44:53 +0300 Subject: [PATCH 04/11] __fastfail bug workaround --- stl/inc/yvals.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index a1ebe2fd072..f67109c002c 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -253,7 +253,9 @@ _EMIT_STL_ERROR(STL1008, "_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER has been #define _MSVC_STL_DOOM_FUNCTION(mesg) ::_invoke_watson(nullptr, nullptr, nullptr, 0, 0) #else // Use the MSVC __fastfail intrinsic: extern "C" __declspec(noreturn) void __fastfail(unsigned int); // declared by -#define _MSVC_STL_DOOM_FUNCTION(mesg) __fastfail(5) // __fastfail(FAST_FAIL_INVALID_ARG), value defined by +#define _MSVC_STL_DOOM_FUNCTION(mesg) \ + __fastfail(5); /* __fastfail(FAST_FAIL_INVALID_ARG), value defined by */ \ + _STL_UNREACHABLE /* TRANSITION, DevCom-10914110 */ #endif // choose "doom function" #endif // ^^^ !defined(_MSVC_STL_DOOM_FUNCTION) ^^^ From 2628a1523ef82a55e15daf7b2cfdf505c892cf6d Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 31 May 2025 17:54:05 +0300 Subject: [PATCH 05/11] Update stl/inc/yvals.h Co-authored-by: Fulgen301 --- stl/inc/yvals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index f67109c002c..0ddcdcb5234 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -254,7 +254,7 @@ _EMIT_STL_ERROR(STL1008, "_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER has been #else // Use the MSVC __fastfail intrinsic: extern "C" __declspec(noreturn) void __fastfail(unsigned int); // declared by #define _MSVC_STL_DOOM_FUNCTION(mesg) \ - __fastfail(5); /* __fastfail(FAST_FAIL_INVALID_ARG), value defined by */ \ + __fastfail(5); /* __fastfail(FAST_FAIL_INVALID_ARG), value defined by */ \ _STL_UNREACHABLE /* TRANSITION, DevCom-10914110 */ #endif // choose "doom function" #endif // ^^^ !defined(_MSVC_STL_DOOM_FUNCTION) ^^^ From 756bcd5e880ef8f0211b649cb898285bfba5176c Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 31 May 2025 17:54:53 +0300 Subject: [PATCH 06/11] Update yvals.h --- stl/inc/yvals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index 0ddcdcb5234..a971b51fb29 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -253,7 +253,7 @@ _EMIT_STL_ERROR(STL1008, "_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER has been #define _MSVC_STL_DOOM_FUNCTION(mesg) ::_invoke_watson(nullptr, nullptr, nullptr, 0, 0) #else // Use the MSVC __fastfail intrinsic: extern "C" __declspec(noreturn) void __fastfail(unsigned int); // declared by -#define _MSVC_STL_DOOM_FUNCTION(mesg) \ +#define _MSVC_STL_DOOM_FUNCTION(mesg) \ __fastfail(5); /* __fastfail(FAST_FAIL_INVALID_ARG), value defined by */ \ _STL_UNREACHABLE /* TRANSITION, DevCom-10914110 */ #endif // choose "doom function" From 84e4d356fcd7cfdd1c1c579ed6b8b3abcda4333e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 2 Jun 2025 15:10:57 -0700 Subject: [PATCH 07/11] Support "continue on error". --- stl/inc/atomic | 1 + stl/inc/functional | 5 +++++ stl/inc/xutility | 1 + 3 files changed, 7 insertions(+) diff --git a/stl/inc/atomic b/stl/inc/atomic index 24d8f82b46f..0eda98a45e6 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -2991,6 +2991,7 @@ public: default: // Unrecognized bit pattern _MSVC_STL_DOOM_FUNCTION("atomic shared_ptr invariant broken"); + break; } } } diff --git a/stl/inc/functional b/stl/inc/functional index 00b804385bd..a6ad4453fc3 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -771,6 +771,7 @@ private: if constexpr (!is_copy_constructible_v<_Callable>) { // used exclusively for packaged_task (void) _Myax; _MSVC_STL_DOOM_FUNCTION("this callable object should not be copied"); + return nullptr; } else if constexpr (_Is_large<_Func_impl>) { _Myalty _Rebound(_Myax); _Alloc_construct_ptr<_Myalty> _Constructor{_Rebound}; @@ -809,6 +810,7 @@ private: #else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv [[noreturn]] const type_info& _Target_type() const noexcept override { _MSVC_STL_DOOM_FUNCTION("type info is disabled"); + _STL_UNREACHABLE; // no return value available for "continue on error" } #endif // ^^^ !_HAS_STATIC_RTTI ^^^ @@ -860,6 +862,7 @@ private: _Mybase* _Copy(void* _Where) const override { if constexpr (!is_copy_constructible_v<_Callable>) { // used exclusively for packaged_task _MSVC_STL_DOOM_FUNCTION("this callable object should not be copied"); + return nullptr; } else if constexpr (_Is_large<_Func_impl_no_alloc>) { return _STD _Global_new<_Func_impl_no_alloc>(_Callee); } else { @@ -890,6 +893,7 @@ private: #else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv [[noreturn]] const type_info& _Target_type() const noexcept override { _MSVC_STL_DOOM_FUNCTION("type info is disabled"); + _STL_UNREACHABLE; // no return value available for "continue on error" } #endif // ^^^ !_HAS_STATIC_RTTI ^^^ @@ -1354,6 +1358,7 @@ template [[noreturn]] _Rx __stdcall _Function_not_callable(const _Move_only_function_data&, _Types&&...) noexcept { _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) + _STL_UNREACHABLE; // no return value available for "continue on error" } template diff --git a/stl/inc/xutility b/stl/inc/xutility index c53c928a27b..9043e52c1cf 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1122,6 +1122,7 @@ struct _Projected_impl { using value_type = remove_cvref_t>; [[noreturn]] indirect_result_t<_Proj&, _It> operator*() const { _MSVC_STL_DOOM_FUNCTION(""); + _STL_UNREACHABLE; // no return value available for "continue on error" } }; }; From c9c2ccd1582235ff0bb29ef6712e3e903707c30a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 2 Jun 2025 15:40:33 -0700 Subject: [PATCH 08/11] Cite Standardese in reasons. --- stl/inc/functional | 3 +-- stl/inc/xutility | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stl/inc/functional b/stl/inc/functional index a6ad4453fc3..adc86c387b8 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -1356,8 +1356,7 @@ inline constexpr size_t _Minimum_function_size = 2 * sizeof(void*); template [[noreturn]] _Rx __stdcall _Function_not_callable(const _Move_only_function_data&, _Types&&...) noexcept { - _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) + _MSVC_STL_DOOM_FUNCTION("empty move_only_function call (N5008 [func.wrap.move.inv]/2)"); _STL_UNREACHABLE; // no return value available for "continue on error" } diff --git a/stl/inc/xutility b/stl/inc/xutility index 9043e52c1cf..495cd7be286 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1121,7 +1121,7 @@ struct _Projected_impl { using value_type = remove_cvref_t>; [[noreturn]] indirect_result_t<_Proj&, _It> operator*() const { - _MSVC_STL_DOOM_FUNCTION(""); + _MSVC_STL_DOOM_FUNCTION("std::projected::operator*() can't be called (N5008 [projected]/1)"); _STL_UNREACHABLE; // no return value available for "continue on error" } }; From cff3b97150d0af219005a3ecd35920815d1931ca Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Wed, 11 Jun 2025 08:47:39 +0300 Subject: [PATCH 09/11] Use _STL_REPORT_ERROR to call _MSVC_STL_DOOM_FUNCTION, like everywhere else --- stl/inc/functional | 10 +++++----- stl/inc/future | 4 ++-- stl/inc/memory | 4 ++-- stl/inc/xcall_once.h | 2 +- stl/inc/xutility | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/stl/inc/functional b/stl/inc/functional index adc86c387b8..6496b8d3dff 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -770,7 +770,7 @@ private: auto& _Myax = _Mypair._Get_first(); if constexpr (!is_copy_constructible_v<_Callable>) { // used exclusively for packaged_task (void) _Myax; - _MSVC_STL_DOOM_FUNCTION("this callable object should not be copied"); + _STL_REPORT_ERROR("this callable object should not be copied"); return nullptr; } else if constexpr (_Is_large<_Func_impl>) { _Myalty _Rebound(_Myax); @@ -809,7 +809,7 @@ private: } #else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv [[noreturn]] const type_info& _Target_type() const noexcept override { - _MSVC_STL_DOOM_FUNCTION("type info is disabled"); + _STL_REPORT_ERROR("type info is disabled"); _STL_UNREACHABLE; // no return value available for "continue on error" } #endif // ^^^ !_HAS_STATIC_RTTI ^^^ @@ -861,7 +861,7 @@ public: private: _Mybase* _Copy(void* _Where) const override { if constexpr (!is_copy_constructible_v<_Callable>) { // used exclusively for packaged_task - _MSVC_STL_DOOM_FUNCTION("this callable object should not be copied"); + _STL_REPORT_ERROR("this callable object should not be copied"); return nullptr; } else if constexpr (_Is_large<_Func_impl_no_alloc>) { return _STD _Global_new<_Func_impl_no_alloc>(_Callee); @@ -892,7 +892,7 @@ private: } #else // ^^^ _HAS_STATIC_RTTI / !_HAS_STATIC_RTTI vvv [[noreturn]] const type_info& _Target_type() const noexcept override { - _MSVC_STL_DOOM_FUNCTION("type info is disabled"); + _STL_REPORT_ERROR("type info is disabled"); _STL_UNREACHABLE; // no return value available for "continue on error" } #endif // ^^^ !_HAS_STATIC_RTTI ^^^ @@ -1356,7 +1356,7 @@ inline constexpr size_t _Minimum_function_size = 2 * sizeof(void*); template [[noreturn]] _Rx __stdcall _Function_not_callable(const _Move_only_function_data&, _Types&&...) noexcept { - _MSVC_STL_DOOM_FUNCTION("empty move_only_function call (N5008 [func.wrap.move.inv]/2)"); + _STL_REPORT_ERROR("empty move_only_function call (N5008 [func.wrap.move.inv]/2)"); _STL_UNREACHABLE; // no return value available for "continue on error" } diff --git a/stl/inc/future b/stl/inc/future index 6e9fe154de7..318427ba744 100644 --- a/stl/inc/future +++ b/stl/inc/future @@ -1319,7 +1319,7 @@ template 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 _MSVC_STL_DOOM_FUNCTION(). When VSO-153581 is + // update, so this adapter turns copies into _STL_REPORT_ERROR(). When VSO-153581 is // fixed, remove this adapter. private: using _Storaget = tuple...>; @@ -1331,7 +1331,7 @@ public: [[noreturn]] _Fake_no_copy_callable_adapter(const _Fake_no_copy_callable_adapter& _Other) : _Storage(_STD move(_Other._Storage)) { - _MSVC_STL_DOOM_FUNCTION("this callable object should not be copied"); // shouldn't be called + _STL_REPORT_ERROR("this callable object should not be copied"); // shouldn't be called } _Fake_no_copy_callable_adapter(_Fake_no_copy_callable_adapter&& _Other) = default; diff --git a/stl/inc/memory b/stl/inc/memory index 967ce2669e2..74d85f4e56e 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -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 { - _MSVC_STL_DOOM_FUNCTION("_Ref_count_base base class member functions should not be called"); + _STL_REPORT_ERROR("_Ref_count_base base class member functions should not be called"); } virtual void _Delete_this() noexcept { - _MSVC_STL_DOOM_FUNCTION("_Ref_count_base base class member functions should not be called"); + _STL_REPORT_ERROR("_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 diff --git a/stl/inc/xcall_once.h b/stl/inc/xcall_once.h index 81dbb819b96..17d32e4680f 100644 --- a/stl/inc/xcall_once.h +++ b/stl/inc/xcall_once.h @@ -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)) { - _MSVC_STL_DOOM_FUNCTION("InitOnceBeginInitialize() failed"); + _STL_REPORT_ERROR("InitOnceBeginInitialize() failed"); } if (_Pending != 0) { diff --git a/stl/inc/xutility b/stl/inc/xutility index 495cd7be286..dbfbad6ce35 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1121,7 +1121,7 @@ struct _Projected_impl { using value_type = remove_cvref_t>; [[noreturn]] indirect_result_t<_Proj&, _It> operator*() const { - _MSVC_STL_DOOM_FUNCTION("std::projected::operator*() can't be called (N5008 [projected]/1)"); + _STL_REPORT_ERROR("std::projected::operator*() can't be called (N5008 [projected]/1)"); _STL_UNREACHABLE; // no return value available for "continue on error" } }; From 81045d7433d91bf35c27eda50005a6db805c3d30 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Wed, 11 Jun 2025 09:33:52 +0300 Subject: [PATCH 10/11] missing occurences --- stl/inc/atomic | 2 +- stl/inc/xlocale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/atomic b/stl/inc/atomic index 0eda98a45e6..929fcd7c26d 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -2990,7 +2990,7 @@ public: break; default: // Unrecognized bit pattern - _MSVC_STL_DOOM_FUNCTION("atomic shared_ptr invariant broken"); + _STL_REPORT_ERROR("atomic shared_ptr invariant broken"); break; } } diff --git a/stl/inc/xlocale b/stl/inc/xlocale index fc2db6c68af..b6c77fd7faa 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -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 - _MSVC_STL_DOOM_FUNCTION("lazy facet disallowed"); + _STL_REPORT_ERROR("lazy facet disallowed"); #endif } else { // queue up lazy facet for destruction auto _Pfmod = const_cast(_Psave); From f598cb54e2c306dbe36fb950d88abb4a32c6f528 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Wed, 11 Jun 2025 09:35:43 +0300 Subject: [PATCH 11/11] missing occurence --- stl/inc/format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/format b/stl/inc/format index 89f2ba974e6..0e6af0261bb 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -3540,7 +3540,7 @@ _NODISCARD _FormatContext::iterator _Tuple_formatter_format(const tuple(_Tmp_str);