https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101435
--- Comment #1 from Tobias Schlüter <tobi at gcc dot gnu.org> --- Grrr, I made a mistake in describing the issue with the code: what is missing is the `template` keyword before `cast`, so it should read return err == 0 ? M{ v.template cast<typename M::Scalar>() } : fallback; ^^^^^^^^^ Of course GCC gives errors everywhere but there :D