diff --git a/include/pybind11/detail/type_caster_base.h b/include/pybind11/detail/type_caster_base.h index c13261538..04e87c24c 100644 --- a/include/pybind11/detail/type_caster_base.h +++ b/include/pybind11/detail/type_caster_base.h @@ -635,8 +635,8 @@ handle smart_holder_from_unique_ptr(std::unique_ptr &&src, const std::pair &st) { 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::move && policy != return_value_policy::reference + && policy != return_value_policy::reference_internal) { // SMART_HOLDER_WIP: IMPROVABLE: Error message. throw cast_error("Invalid return_value_policy for unique_ptr."); }