diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-10-07 21:54:49 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-10-07 21:54:49 +0200 |
commit | 16b2001eceac03a3adf981f4bc02b72583433ab1 (patch) | |
tree | 03bd24163fa3cf8b16e0d209f792871bb527edc3 /test/stdvector.cpp | |
parent | 6512c5e1364d466f1c225039e3a02c83a79ada17 (diff) |
Fix gcc 8.1 warning: "maybe use uninitialized"
Diffstat (limited to 'test/stdvector.cpp')
-rw-r--r-- | test/stdvector.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/stdvector.cpp b/test/stdvector.cpp index 9a7040874..18de240c6 100644 --- a/test/stdvector.cpp +++ b/test/stdvector.cpp @@ -17,7 +17,7 @@ void check_stdvector_matrix(const MatrixType& m) Index rows = m.rows(); Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); - std::vector<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType(rows,cols)), w(20, y); + std::vector<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows,cols)), w(20, y); v[5] = x; w[6] = v[5]; VERIFY_IS_APPROX(w[6], v[5]); @@ -86,8 +86,8 @@ template<typename QuaternionType> void check_stdvector_quaternion(const QuaternionType&) { typedef typename QuaternionType::Coefficients Coefficients; - QuaternionType x(Coefficients::Random()), y(Coefficients::Random()); - std::vector<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10), w(20, y); + QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity(); + std::vector<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10,qi), w(20, y); v[5] = x; w[6] = v[5]; VERIFY_IS_APPROX(w[6], v[5]); |