Eigen 3.3.8 fails to build with GCC 7.3/Ubuntu with -Werror -Wduplicated-branches
Eigen 3.3.8 fails to build with GCC 7.3/Ubuntu with -Werror -Wduplicated-branches.
Produces a lot of errors like:
cc1plus: error: this condition has identical branches [-Werror=duplicated-branches]
Compiler: g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Using #pragma GCC diagnostic ignored "-Wduplicated-branches"
doesn't help at all (looks like due known GCC bug - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83591).
Makes sense to revisit failed code and fix it if possible.
Minimal sample to reproduce (test.cpp):
#pragma GCC diagnostic ignored "-Wduplicated-branches"
#include <Eigen/Eigen>
int main()
{
return 0;
}
Compile as: g++ test.cpp -Werror -Wduplicated-branches
Edited by Rostislav Ostapenko