Skip to content

Commit ca1e08d

Browse files
YannickJadoulbstaletic
authored andcommitted
Go home, MSVC, you're drunk
1 parent 257af0e commit ca1e08d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/pybind11/pybind11.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ class cpp_function : public function {
162162
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
163163
#endif
164164
// UB without std::launder, but without breaking ABI and/or
165-
// a significant refactoring it's "impossible" to solve'
165+
// a significant refactoring it's "impossible" to solve.
166166
if (!std::is_trivially_destructible<Func>::value)
167167
rec->free_data = [](function_record *r) {
168-
auto cap = PYBIND11_STD_LAUNDER((capture *) &r->data);
169-
cap->~capture();
168+
auto data = PYBIND11_STD_LAUNDER((capture *) &r->data);
169+
(void) data;
170+
data->~capture();
170171
};
171172
#if defined(__GNUG__) && !PYBIND11_HAS_STD_LAUNDER
172173
# pragma GCC diagnostic pop

0 commit comments

Comments
 (0)