diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp index bb213368e..79720145e 100644 --- a/test/product_notemporary.cpp +++ b/test/product_notemporary.cpp @@ -110,11 +110,11 @@ template void product_notemporary(const MatrixType& m) VERIFY_EVALUATION_COUNT( m3.noalias() = m1.block(r0,r0,r1,r1).template triangularView() * m2.block(r0,c0,r1,c1), 1); // Zero temporaries for lazy products ... - VERIFY_EVALUATION_COUNT( Scalar tmp = Scalar(RealScalar(1)) / (m3.transpose().lazyProduct(m3)).diagonal().sum(), 0 ); + VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) / (m3.transpose().lazyProduct(m3)).diagonal().sum(), 0 ); // ... and one temporary for even deeply (>=2) nested products - VERIFY_EVALUATION_COUNT( Scalar tmp = Scalar(RealScalar(1)) / (m3.transpose() * m3).diagonal().sum(), 1 ); - VERIFY_EVALUATION_COUNT( Scalar tmp = Scalar(RealScalar(1)) / (m3.transpose() * m3).diagonal().array().abs().sum(), 1 ); + VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) / (m3.transpose() * m3).diagonal().sum(), 1 ); + VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) / (m3.transpose() * m3).diagonal().array().abs().sum(), 1 ); // Zero temporaries for ... CoeffBasedProductMode // - does not work with GCC because of the <..>, we'ld need variadic macros ...