mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-15 13:15:57 +08:00
Initialize primitives to fix -Wuninitialized-const-reference.
The `meta` test generates warnings with the latest version of clang due to passing uninitialized variables as const reference arguments. ``` test/meta.cpp:102:45: error: variable 'f' is uninitialized when passed as a const reference argument here [-Werror,-Wuninitialized-const-reference] VERIFY(( check_is_convertible(a.dot(b), f) )); ``` We don't actually use the variables, but initializing them eliminates the new warning. Fixes #2067.
This commit is contained in:
parent
3669498f5a
commit
41d5d5334b
@ -96,7 +96,7 @@ EIGEN_DECLARE_TEST(meta)
|
|||||||
STATIC_CHECK((!internal::is_convertible<Array33f,int>::value ));
|
STATIC_CHECK((!internal::is_convertible<Array33f,int>::value ));
|
||||||
STATIC_CHECK((!internal::is_convertible<MatrixXf,float>::value ));
|
STATIC_CHECK((!internal::is_convertible<MatrixXf,float>::value ));
|
||||||
{
|
{
|
||||||
float f;
|
float f = 0.0f;
|
||||||
MatrixXf A, B;
|
MatrixXf A, B;
|
||||||
VectorXf a, b;
|
VectorXf a, b;
|
||||||
VERIFY(( check_is_convertible(a.dot(b), f) ));
|
VERIFY(( check_is_convertible(a.dot(b), f) ));
|
||||||
@ -126,7 +126,7 @@ EIGEN_DECLARE_TEST(meta)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i = 0;
|
||||||
VERIFY(( check_is_convertible(fix<3>(), i) ));
|
VERIFY(( check_is_convertible(fix<3>(), i) ));
|
||||||
VERIFY((!check_is_convertible(i, fix<DynamicIndex>()) ));
|
VERIFY((!check_is_convertible(i, fix<DynamicIndex>()) ));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user