diff --git a/include/pybind11/detail/smart_holder_type_casters.h b/include/pybind11/detail/smart_holder_type_casters.h index 67d7c4f1..bd9483a0 100644 --- a/include/pybind11/detail/smart_holder_type_casters.h +++ b/include/pybind11/detail/smart_holder_type_casters.h @@ -965,6 +965,7 @@ struct smart_holder_type_caster> : smart_holder_type_caste static handle cast(std::unique_ptr &&src, return_value_policy policy, handle parent) { if (policy != return_value_policy::automatic + && policy != return_value_policy::automatic_reference && policy != return_value_policy::reference_internal && policy != return_value_policy::move && policy != return_value_policy::_clif_automatic) {