Core: Guard out-of-class constexpr member definitions for C++17

libeigen/eigen!3675

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h
index 9cecb9d..af09d9c 100644
--- a/Eigen/src/Core/Diagonal.h
+++ b/Eigen/src/Core/Diagonal.h
@@ -70,11 +70,13 @@
                                                       : MatrixTypeOuterStride + MatrixTypeInnerStride;
 };
 
+// Redundant out-of-class definitions are required pre-C++17 but deprecated since.
+#if EIGEN_COMP_CXXVER < 17
 template <typename MatrixType, int DiagIndex>
 constexpr int traits<Diagonal<MatrixType, DiagIndex>>::MatrixTypeInnerStride;
-
 template <typename MatrixType, int DiagIndex>
 constexpr int traits<Diagonal<MatrixType, DiagIndex>>::InnerStrideAtCompileTime;
+#endif
 }  // namespace internal
 
 template <typename MatrixType, int DiagIndex_>
diff --git a/Eigen/src/SparseCholesky/MultifrontalLDLT.h b/Eigen/src/SparseCholesky/MultifrontalLDLT.h
index a1a8897..f97229a 100644
--- a/Eigen/src/SparseCholesky/MultifrontalLDLT.h
+++ b/Eigen/src/SparseCholesky/MultifrontalLDLT.h
@@ -596,12 +596,15 @@
   bool m_hasZeroPivot = false;
 };
 
+// Redundant out-of-class definitions are required pre-C++17 but deprecated since.
+#if EIGEN_COMP_CXXVER < 17
 template <typename MatrixType_, int UpLo_, typename Ordering_>
 constexpr int MultifrontalLDLT<MatrixType_, UpLo_, Ordering_>::UpLo;
 template <typename MatrixType_, int UpLo_, typename Ordering_>
 constexpr int MultifrontalLDLT<MatrixType_, UpLo_, Ordering_>::ColsAtCompileTime;
 template <typename MatrixType_, int UpLo_, typename Ordering_>
 constexpr int MultifrontalLDLT<MatrixType_, UpLo_, Ordering_>::MaxColsAtCompileTime;
+#endif
 
 template <typename MatrixType_, int UpLo_, typename Ordering_>
 void MultifrontalLDLT<MatrixType_, UpLo_, Ordering_>::mergeRelaxedFronts(const std::vector<StorageIndex>& frontParent,
diff --git a/test/lifetime_scalar.h b/test/lifetime_scalar.h
index 28ef581..9d85288 100644
--- a/test/lifetime_scalar.h
+++ b/test/lifetime_scalar.h
@@ -71,8 +71,11 @@
   }
 };
 
+// Redundant out-of-class definitions are required pre-C++17 but deprecated since.
+#if EIGEN_COMP_CXXVER < 17
 template <std::size_t Alignment>
 constexpr Index LifetimeScalar<Alignment>::kUnlimited;
+#endif
 template <std::size_t Alignment>
 Index LifetimeScalar<Alignment>::live = 0;
 template <std::size_t Alignment>