OK, I was able to minimize the test case (following instructions from gcc) down to a single line from Eigen that causes the problem, and filed a bug report here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
OK, I've narrowed down the issue to a simple test case, and found that it has to do with including Eigen/Core between different operator declarations. In the actual project this is due to various nested includes, some using Eigen, some not. test.cc class A { private: friend int &operator<<(int &i, const A &value) { return i; } }; #include <Eigen/Core> class B {}; int &operator<<(int &i, const B &ast); my compile command is x86_64-w64-mingw32.static.posix-g++ -c -isystem /mxe/usr/x86_64-w64-mingw32.static.posix/include/eigen3...
OK, I've narrowed down the issue to a simple test case, and found that it has to do with including Eigen/Core between different operator declarations. In the actual project this is due to various nested includes, some using Eigen, some not. test.cc class A { private: friend int &operator<<(int &i, const A &value) { return i; } }; #include <Eigen/Core> class B {}; int &operator<<(int &i, const B &ast); my compile command is x86_64-w64-mingw32.static.posix-g++ -c -isystem /mxe/usr/x86_64-w64-mingw32.static.posix/include/eigen3...
Overwhelming number of "optimization attribute" warnings