From e02fe001cdb9bc252efdfe8f08486de09e369737 Mon Sep 17 00:00:00 2001 From: Ivor Wanders Date: Mon, 6 Nov 2023 18:56:21 -0500 Subject: [PATCH] fix(smart_holder): Use std::default_delete. (#4924) Ensures `std::default_delete` is used to look up the deleter for a type instead of `delete` directly. --- include/pybind11/detail/smart_holder_poc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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>