Skip to content

Commit 8196ecf

Browse files
authored
move_only_function: remove workaround for broken noexcept(param) (#5809)
1 parent 1717ac0 commit 8196ecf

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

stl/inc/functional

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,17 +1535,6 @@ _NODISCARD void* _Function_new_large(_CTypes&&... _Args) {
15351535
template <class _Rx, bool _Noexcept, class... _Types>
15361536
class _Move_only_function_base {
15371537
public:
1538-
// TRANSITION, DevCom-1208330: use noexcept(_Noexcept) instead
1539-
template <bool>
1540-
struct _Invoke_t {
1541-
using _Call = _Rx(__stdcall*)(const _Move_only_function_data&, _Types&&...);
1542-
};
1543-
1544-
template <>
1545-
struct _Invoke_t<true> {
1546-
using _Call = _Rx(__stdcall*)(const _Move_only_function_data&, _Types&&...) _NOEXCEPT_FNPTR;
1547-
};
1548-
15491538
struct _Impl_t { // A per-callable-type structure acting as a virtual function table.
15501539
// Using vtable emulations gives more flexibility for optimizations and reduces the amount of RTTI data.
15511540
// (The RTTI savings may be significant as with lambdas and binds there may be many distinct callable types.
@@ -1555,7 +1544,7 @@ public:
15551544
// empty function from a DLL that is unloaded later, and then safely moving/destroying that empty function.
15561545

15571546
// Calls target
1558-
_Invoke_t<_Noexcept>::_Call _Invoke;
1547+
_Rx(__stdcall* _Invoke)(const _Move_only_function_data&, _Types&&...) _NOEXCEPT_FNPTR_COND(_Noexcept);
15591548
// Moves the data, including pointer to "vtable", AND destroys old data (not resetting its "vtable").
15601549
// nullptr if we can trivially move two pointers.
15611550
void(__stdcall* _Move)(_Move_only_function_data&, _Move_only_function_data&) _NOEXCEPT_FNPTR;

stl/inc/yvals_core.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,9 +1992,11 @@ compiler option, or define _ALLOW_RTCc_IN_STL to suppress this error.
19921992
#endif // !defined(_STL_WIN32_WINNT)
19931993

19941994
#ifdef __cpp_noexcept_function_type
1995-
#define _NOEXCEPT_FNPTR noexcept
1995+
#define _NOEXCEPT_FNPTR noexcept
1996+
#define _NOEXCEPT_FNPTR_COND(...) noexcept(__VA_ARGS__)
19961997
#else // ^^^ defined(__cpp_noexcept_function_type) / !defined(__cpp_noexcept_function_type) vvv
19971998
#define _NOEXCEPT_FNPTR
1999+
#define _NOEXCEPT_FNPTR_COND(...)
19982000
#endif // ^^^ !defined(__cpp_noexcept_function_type) ^^^
19992001

20002002
#ifdef __clang__

0 commit comments

Comments
 (0)