diff --git a/Eigen/src/Core/util/IntegralConstant.h b/Eigen/src/Core/util/IntegralConstant.h index 945d426ea..e0092f654 100644 --- a/Eigen/src/Core/util/IntegralConstant.h +++ b/Eigen/src/Core/util/IntegralConstant.h @@ -138,7 +138,7 @@ template struct get_fixed_value,Default> { static const int value = N; }; -#if !EIGEN_HAS_CXX14 +#if !EIGEN_HAS_CXX14_VARIABLE_TEMPLATES template struct get_fixed_value (*)(),Default> { static const int value = N; }; @@ -154,7 +154,7 @@ struct get_fixed_value,Default> { }; template EIGEN_DEVICE_FUNC Index get_runtime_value(const T &x) { return x; } -#if !EIGEN_HAS_CXX14 +#if !EIGEN_HAS_CXX14_VARIABLE_TEMPLATES template EIGEN_DEVICE_FUNC Index get_runtime_value(FixedInt (*)()) { return N; } #endif @@ -166,7 +166,7 @@ template struct clea // Convert any integral type (e.g., short, int, unsigned int, etc.) to Eigen::Index template struct cleanup_index_type::value>::type> { typedef Index type; }; -#if !EIGEN_HAS_CXX14 +#if !EIGEN_HAS_CXX14_VARIABLE_TEMPLATES // In c++98/c++11, fix is a pointer to function that we better cleanup to a true FixedInt: template struct cleanup_index_type (*)(), DynamicKey> { typedef FixedInt type; }; #endif diff --git a/test/symbolic_index.cpp b/test/symbolic_index.cpp index b114cbb95..a75ca1165 100644 --- a/test/symbolic_index.cpp +++ b/test/symbolic_index.cpp @@ -58,15 +58,15 @@ void check_symbolic_index() VERIFY( is_same_type( fix<9>()/2, int(9/2) ) ); VERIFY( is_same_symb( lastp1-1, last, size) ); - VERIFY( is_same_symb( lastp1-fix<1>, last, size) ); + VERIFY( is_same_symb( lastp1-fix<1>(), last, size) ); VERIFY_IS_EQUAL( ( (last*5-2)/3 ).eval(last=size-1), ((size-1)*5-2)/3 ); - VERIFY_IS_EQUAL( ( (last*fix<5>-fix<2>)/fix<3> ).eval(last=size-1), ((size-1)*5-2)/3 ); + VERIFY_IS_EQUAL( ( (last*fix<5>()-fix<2>())/fix<3>() ).eval(last=size-1), ((size-1)*5-2)/3 ); VERIFY_IS_EQUAL( ( -last*lastp1 ).eval(last=size-1), -(size-1)*size ); VERIFY_IS_EQUAL( ( lastp1-3*last ).eval(last=size-1), size- 3*(size-1) ); VERIFY_IS_EQUAL( ( (lastp1-3*last)/lastp1 ).eval(last=size-1), (size- 3*(size-1))/size ); -#if EIGEN_HAS_CXX14 +#if EIGEN_HAS_CXX14_VARIABLE_TEMPLATES { struct x_tag {}; static const symbolic::SymbolExpr x; struct y_tag {}; static const symbolic::SymbolExpr y;