We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 257af0e commit 98bae49Copy full SHA for 98bae49
include/pybind11/pybind11.h
@@ -164,10 +164,7 @@ class cpp_function : public function {
164
// UB without std::launder, but without breaking ABI and/or
165
// a significant refactoring it's "impossible" to solve'
166
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
- };
+ rec->free_data = [](function_record *r) { auto data = PYBIND11_STD_LAUNDER((capture *) &r->data); (void) data; data->~capture(); };
171
#if defined(__GNUG__) && !PYBIND11_HAS_STD_LAUNDER
172
# pragma GCC diagnostic pop
173
#endif
0 commit comments