From 0af63493fdb12cea2fdfbabfbddbd4db44587047 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Tue, 20 Oct 2015 11:53:30 -0700 Subject: [PATCH] Disable SFINAE for versions of gcc older than 4.8 --- unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h index 6d9cc4f38..939de5f11 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h @@ -26,8 +26,17 @@ * void foo(){} */ +// SFINAE requires variadic templates #ifdef EIGEN_HAS_VARIADIC_TEMPLATES -#define EIGEN_HAS_SFINAE + // SFINAE doesn't work for gcc <= 4.7 + #ifdef EIGEN_COMP_GNUC + #if EIGEN_GNUC_AT_LEAST(4,8) + #define EIGEN_HAS_SFINAE + #endif + #else + #define EIGEN_HAS_SFINAE + #endif + #endif #define EIGEN_SFINAE_ENABLE_IF( __condition__ ) \