diff --git a/include/pybind11/detail/smart_holder_poc.h b/include/pybind11/detail/smart_holder_poc.h index 0f71586f7e..89742ab27e 100644 --- a/include/pybind11/detail/smart_holder_poc.h +++ b/include/pybind11/detail/smart_holder_poc.h @@ -103,7 +103,7 @@ struct guarded_delete { template ::value, int>::type = 0> inline void builtin_delete_if_destructible(void *raw_ptr) { - delete static_cast(raw_ptr); + std::default_delete{}(static_cast(raw_ptr)); } template ::value, int>::type = 0>