Guard SimplicialCholesky kEmpty redeclaration for C++17+

Follow-up to !2299 (merged): one instance of the same deprecated pattern was overlooked, as pointed out by @jwnimmer-tri in !2299 (comment 3237197159).

Since C++17, constexpr static data members are implicitly inline, making out-of-class definitions redundant and deprecated. The previous MR added an EIGEN_COMP_CXXVER < 17 guard around the numeric_limits_half_impl and numeric_limits_bfloat16_impl definitions but missed the same pattern in SimplicialCholesky_impl.h:

Eigen/src/SparseCholesky/SimplicialCholesky_impl.h:279:24: warning: redundant redeclaration of 'constexpr' static data member 'Eigen::internal::simpl_chol_helper<Scalar, StorageIndex>::kEmpty' [-Wdeprecated]
  279 | constexpr StorageIndex simpl_chol_helper<Scalar, StorageIndex>::kEmpty;

This MR wraps the kEmpty redeclaration in the same guard, eliminating the remaining warning while keeping the out-of-class definition for pre-C++17 compilers that still need it for ODR.

Verification

Reproduced the warning with GCC 15.2.0 at -std=c++20 -Wdeprecated against current master, applied the fix, and re-verified:

  • C++14: builds clean (definition still emitted)
  • C++17: builds clean (definition guarded out)
  • C++20: builds clean (definition guarded out, warning gone)

Also ran a behavioral sanity check (SimplicialLDLT solve) to confirm no ODR/link regression.

Merge request reports

Loading
Loading