diff --git a/test/reshape.cpp b/test/reshape.cpp index 7c76cd525..417d18abe 100644 --- a/test/reshape.cpp +++ b/test/reshape.cpp @@ -19,7 +19,7 @@ std::enable_if_t::value, bool> is_same_eq(const T1& a, } template -void check_auto_reshape4x4(MatType m) { +void check_auto_reshape4x4(const MatType& m) { internal::VariableAndFixedInt v1(1); internal::VariableAndFixedInt v2(2); internal::VariableAndFixedInt v4(4); @@ -50,10 +50,10 @@ void check_auto_reshape4x4(MatType m) { } template -void check_direct_access_reshape4x4(MatType, internal::FixedInt) {} +void check_direct_access_reshape4x4(const MatType&, internal::FixedInt) {} template -void check_direct_access_reshape4x4(MatType m, internal::FixedInt<0>) { +void check_direct_access_reshape4x4(const MatType& m, internal::FixedInt<0>) { VERIFY_IS_EQUAL(m.reshaped(1, 16).data(), m.data()); VERIFY_IS_EQUAL(m.reshaped(1, 16).innerStride(), 1); @@ -64,8 +64,9 @@ void check_direct_access_reshape4x4(MatType m, internal::FixedInt<0>) { // just test a 4x4 matrix, enumerate all combination manually template -void reshape4x4(MatType m) { +void reshape4x4(const MatType& m0) { typedef typename MatType::Scalar Scalar; + MatType m = m0; internal::VariableAndFixedInt v1(1); internal::VariableAndFixedInt v2(2);