Skip to content

eigen 3.3.9 fails to build with gcc 11

Seeing this now in Fedora rawhide:

/builddir/build/BUILD/eigen-3.3.9/Eigen/src/Core/MathFunctions.h: In instantiation of 'static Scalar Eigen::internal::log1p_impl<Scalar>::run(const Scalar&) [with Scalar = float]':
/builddir/build/BUILD/eigen-3.3.9/Eigen/src/Core/MathFunctions.h:943:49:   required from 'typename Eigen::internal::log1p_retval<typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type>::type Eigen::numext
::log1p(const Scalar&) [with Scalar = float; typename Eigen::internal::log1p_retval<typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type>::type = float; typename Eigen::internal::global_math_functions_f
iltering_base<Scalar>::type = float]'
/builddir/build/BUILD/eigen-3.3.9/Eigen/src/Core/arch/CUDA/Half.h:466:37:   required from here
/builddir/build/BUILD/eigen-3.3.9/Eigen/src/Core/MathFunctions.h:489:25: error: 'Scalar Eigen::internal::std_fallback::log1p(const Scalar&)' conflicts with a previous declaration
  489 |     using std_fallback::log1p;
      |                         ^~~~~
In file included from /usr/include/c++/11/complex:44,
                 from /builddir/build/BUILD/eigen-3.3.9/Eigen/Core:96,
                 from /builddir/build/BUILD/eigen-3.3.9/doc/examples/nullary_indexing.cpp:1:
/usr/include/c++/11/cmath:1563:5: note: previous declaration 'namespace std { }::log1p'
 1563 |     log1p(_Tp __x)
      |     ^~~~~

https://bugzilla.redhat.com/show_bug.cgi?id=1917457