Skip to content

Commit e6ddb66

Browse files
committed
Go home, MSVC, you're drunk
1 parent 257af0e commit e6ddb66

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/pybind11/pybind11.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,7 @@ class cpp_function : public function {
164164
// UB without std::launder, but without breaking ABI and/or
165165
// a significant refactoring it's "impossible" to solve'
166166
if (!std::is_trivially_destructible<Func>::value)
167-
rec->free_data = [](function_record *r) {
168-
auto cap = PYBIND11_STD_LAUNDER((capture *) &r->data);
169-
cap->~capture();
170-
};
167+
rec->free_data = [](function_record *r) { auto data = PYBIND11_STD_LAUNDER((capture *) &r->data); (void data); data->~capture(); };
171168
#if defined(__GNUG__) && !PYBIND11_HAS_STD_LAUNDER
172169
# pragma GCC diagnostic pop
173170
#endif

0 commit comments

Comments
 (0)