MSYS2上gcc 8.2.1的本征编译错误

时间:2018-12-19 00:10:12

标签: c++ gcc eigen eigen3 msys2

我们正在根据Eigen 3.3.7(可能还有较旧的版本)根据MSYS2提供的最新版本的GCC 8.2.1进行facing errors编译。奇怪的是,这仅在同一软件包的最新版本(mingw-w64-x86_64-gcc 8.2.1)中发生:

  • 8.2.1 + 20181123-1:很好
  • 8.2.1 + 20181130-1:错误
  • 8.2.1 + 20181207-1:错误

错误是:

In file included from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/SparseCore:50,
                 from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Sparse:26,
                 from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Eigen:2,
                 from src/registration/transform/search.h:21,
                 from src/registration/transform/initialiser_helpers.cpp:20:
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h: In member function 'Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::BlockType& Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::operator=(const BlockType&)':
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h:216:33: error: expected primary-expression before '>' token
       return operator=<BlockType>(other);

                             ^

我假设这是MSYS2提供的GCC软件包中的错误,而不是Eigen(据我所知SparseBlock.h文件已经有一段时间没有更改了)。不同的GCC是否基于相同的源代码?知道可能是什么问题吗?


编辑:这是MCVE:

test.cpp:

#include <Eigen/Eigen>
int main () { return 0; }

使用g ++ 8.2.1(8.2.1 + 20181130-1版或更高版本-较旧版本没有错误)进行编译:

$ g++ $(pkg-config --cflags eigen3) test.cpp -o test
In file included from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/SparseCore:50,
                 from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Sparse:26,
                 from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Eigen:2,
                 from test.cpp:1:
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h: In member function 'Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::BlockType& Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::operator=(const BlockType&)':
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h:216:33: error: expected primary-expression before '>' token
       return operator=<BlockType>(other);
                                 ^

1 个答案:

答案 0 :(得分:3)

进一步的调查表明这确实是一个GCC错误。我已经reported this on GCC Bugzilla,并且我将关闭此线程。谢谢!