https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115291
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- See https://libeigen.gitlab.io/docs/TopicPitfalls.html section "C++11 and the auto keyword" explictly. "In short: do not use the auto keywords with Eigen's expressions, unless you are 100% sure about what you are doing. In particular, do not use the auto keyword as a replacement for a Matrix<> type." Describes the issue you are having.