aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-10 18:57:28 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-10 18:57:28 +0200
commita80a290079499a12246939d79e955dbce5f6fc4a (patch)
tree929bafa8381a606775cde3cc7390fb84990daa4e
parent6dcd2642aae67d0bc46eee959a9f196e6ea51e7c (diff)
Fix 'template argument uses local type'-warnings (when compiled in C++03 mode)
-rw-r--r--test/indexed_view.cpp10
-rw-r--r--test/integer_types.cpp4
2 files changed, 12 insertions, 2 deletions
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp
index 7219c777f..e6ffe5a74 100644
--- a/test/indexed_view.cpp
+++ b/test/indexed_view.cpp
@@ -77,6 +77,9 @@ is_same_seq_type(const T1& a, const T2& b)
#define VERIFY_EQ_INT(A,B) VERIFY_IS_APPROX(int(A),int(B))
+// C++03 does not allow local or unnamed enums as index
+enum DummyEnum { XX=0, YY=1 };
+
void check_indexed_view()
{
using Eigen::placeholders::all;
@@ -375,9 +378,16 @@ void check_indexed_view()
}
// Check compilation of enums as index type:
+ a(XX) = 1;
+ A(XX,YY) = 1;
+ // Anonymous enums only work with C++11
+#if EIGEN_HAS_CXX11
enum { X=0, Y=1 };
a(X) = 1;
A(X,Y) = 1;
+ A(XX,Y) = 1;
+ A(X,YY) = 1;
+#endif
// Check compilation of varying integer types as index types:
Index i = n/2;
diff --git a/test/integer_types.cpp b/test/integer_types.cpp
index e9e514f12..3f9030d77 100644
--- a/test/integer_types.cpp
+++ b/test/integer_types.cpp
@@ -134,8 +134,8 @@ template<typename MatrixType> void integer_type_tests(const MatrixType& m)
template<int>
void integer_types_extra()
{
- VERIFY_IS_EQUAL(internal::scalar_div_cost<int>::value, 8);
- VERIFY_IS_EQUAL(internal::scalar_div_cost<unsigned int>::value, 8);
+ VERIFY_IS_EQUAL(int(internal::scalar_div_cost<int>::value), 8);
+ VERIFY_IS_EQUAL(int(internal::scalar_div_cost<unsigned int>::value), 8);
if(sizeof(long)>sizeof(int)) {
VERIFY(int(internal::scalar_div_cost<long>::value) > int(internal::scalar_div_cost<int>::value));
VERIFY(int(internal::scalar_div_cost<unsigned long>::value) > int(internal::scalar_div_cost<int>::value));