Skip to content

Unittest `basicstuff` failing when CXX11 is enabled.

Just tried to run make check on latest Eigen and it fails compiling basicstuff with the following error

call of overloaded 'complex(const Eigen::bfloat16&)' is ambiguous
  385 |     return static_cast<NewType>(x);
      |            ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/caldeira/workspace/eigen_everton/eigen/test/main.h:42,
                 from /home/caldeira/workspace/eigen_everton/eigen/test/basicstuff.cpp:12:
/opt/fsf-gcc10-test/include/c++/10.1.1/complex:1234:26: note: candidate: 'constexpr std::complex<double>::complex(double, double)'
 1234 |       _GLIBCXX_CONSTEXPR complex(double __r = 0.0, double __i = 0.0)
      |                          ^~~~~~~
/opt/fsf-gcc10-test/include/c++/10.1.1/complex:1232:26: note: candidate: 'constexpr std::complex<double>::complex(std::complex<double>::_ComplexT)'
 1232 |       _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
      |                          ^~~~~~~
/opt/fsf-gcc10-test/include/c++/10.1.1/complex:1227:12: note: candidate: 'constexpr std::complex<double>::complex(const std::complex<double>&)'
 1227 |     struct complex<double>

this fails to appear once you turn CXX11 off.

Tested on Intel and ppc64le.

Edited by Everton Constantino