diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 5ab54efa3..8c8ca7347 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -621,17 +621,19 @@ class DenseBase protected: EIGEN_DEFAULT_COPY_CONSTRUCTOR(DenseBase) /** Default constructor. Do nothing. */ +#ifdef EIGEN_INTERNAL_DEBUGGING EIGEN_DEVICE_FUNC constexpr DenseBase() { /* Just checks for self-consistency of the flags. * Only do it when debugging Eigen, as this borders on paranoia and could slow compilation down */ -#ifdef EIGEN_INTERNAL_DEBUGGING EIGEN_STATIC_ASSERT( (internal::check_implication(MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1, int(IsRowMajor)) && internal::check_implication(MaxColsAtCompileTime == 1 && MaxRowsAtCompileTime != 1, int(!IsRowMajor))), INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION) -#endif } +#else + EIGEN_DEVICE_FUNC constexpr DenseBase() = default; +#endif private: EIGEN_DEVICE_FUNC explicit DenseBase(int); diff --git a/test/constexpr.cpp b/test/constexpr.cpp index ee154f8c1..9fdf4478a 100644 --- a/test/constexpr.cpp +++ b/test/constexpr.cpp @@ -7,6 +7,7 @@ // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +#define EIGEN_TESTING_CONSTEXPR #include "main.h" EIGEN_DECLARE_TEST(constexpr) { diff --git a/test/main.h b/test/main.h index 2e849f0fe..d12edfdff 100644 --- a/test/main.h +++ b/test/main.h @@ -336,7 +336,9 @@ static std::vector eigen_assert_list; #endif // EIGEN_NO_ASSERTION_CHECKING +#ifndef EIGEN_TESTING_CONSTEXPR #define EIGEN_INTERNAL_DEBUGGING +#endif #include // required for createRandomPIMatrixOfRank and generateRandomMatrixSvs inline void verify_impl(bool condition, const char* testname, const char* file, int line,