diff --git a/include/pybind11/eigen/matrix.h b/include/pybind11/eigen/matrix.h index 5f5ad3867..c21177f05 100644 --- a/include/pybind11/eigen/matrix.h +++ b/include/pybind11/eigen/matrix.h @@ -360,6 +360,9 @@ private: return eigen_ref_array(*src); case return_value_policy::reference_internal: return eigen_ref_array(*src, parent); + case return_value_policy::_return_as_bytes: + pybind11_fail("return_value_policy::_return_as_bytes does not apply."); + break; default: throw cast_error("unhandled return_value_policy: should not happen!"); }; diff --git a/include/pybind11/eigen/tensor.h b/include/pybind11/eigen/tensor.h index a823c0f39..343e31b80 100644 --- a/include/pybind11/eigen/tensor.h +++ b/include/pybind11/eigen/tensor.h @@ -316,6 +316,10 @@ struct type_caster::ValidType> { writeable = !std::is_const::value; break; + case return_value_policy::_return_as_bytes: + pybind11_fail("return_value_policy::_return_as_bytes does not apply."); + break; + default: pybind11_fail("pybind11 bug in eigen.h, please file a bug report"); }