Eclipse CDT 语法错误解析器 false error with Mat assignment: It compiles and runs ok

Eclipse CDT syntax error parser false error with Mat assignment: It compiles and runs ok

在这行代码中,x 是带有红色下划线的错误:

cv::Mat x = cv::Mat::eye(2,2,CV_8U);

具有以下描述:

Invalid arguments '
Candidates are:
 Mat()
 Mat(int, int, int)
 Mat(int, int, int, const cv::Scalar_<double> &)
 ... (it goes on, full error description at the bottom)

编译运行正常

09:12:02 Build Finished. 0 errors, 0 warnings. (took 1s.721ms)

它曾经工作得很好。我不能确切地说这是什么时候开始的,但在中间我将 Eclipse 更新到最后一个稳定版本版本:2019-06 (4.12.0) Build id:20190614-1200.

这是解析器的问题。我使用 elf-parser 作为错误解析器(Linux 的默认配置)。我尝试使用 c++11 和 c++17,但没有告诉我使用哪个 C++。

MatExpr 分配给 Mat 声明时会发生一般错误。 MatExpr 应该会自动转换为 Mat(就像往常一样)。它对 opencv 太具体了,但有时错误解析器无法识别 std::endl,所以我相信解析器的问题不是 opencv 特有的。

完整的完整错误描述,我很确定这里没有任何相关内容:

Invalid arguments '
Candidates are:
 Mat()
 Mat(int, int, int)
 Mat(int, int, int, const cv::Scalar_<double> &)
 Mat(cv::Size_<int>, int)
 Mat(cv::Size_<int>, int, const cv::Scalar_<double> &)
 Mat(int, const int *, int)
 Mat(int, const int *, int, const cv::Scalar_<double> &)
 Mat(const std::vector<int,std::allocator<int>> &, int)
 Mat(const std::vector<int,std::allocator<int>> &, int, const cv::Scalar_<double> &)
 Mat(const cv::Mat &)
 Mat(int, int, int, void *, unsigned long int)
 Mat(cv::Size_<int>, int, void *, unsigned long int)
 Mat(const std::vector<#0,std::allocator<#0>> &, bool)
 Mat(std::initializer_list<#0>)
 Mat(std::initializer_list<int>, std::initializer_list<#0>)
 Mat(const std::array<#0,unsigned long int3 #1 0> &, bool)
 Mat(const cv::Vec<#0,int3 #1 0> &, bool)
 Mat(const cv::Matx<#0,int3 #1 0,int3 #2 0> &, bool)
 Mat(const cv::Point_<#0> &, bool)
 Mat(const cv::Point3_<#0> &, bool)
 Mat(const cv::MatCommaInitializer_<#0> &)
 Mat(const cv::Mat &, const cv::Range &, const cv::Range &)
 Mat(const cv::Mat &, const cv::Rect_<int> &)
 Mat(const cv::Mat &, const cv::Range *)
 Mat(const cv::Mat &, const std::vector<cv::Range,std::allocator<cv::Range>> &)
 Mat(cv::Mat &&)
 Mat(int, const int *, int, void *, const unsigned long int *)
 Mat(const std::vector<int,std::allocator<int>> &, int, void *, const unsigned long int *)
 Mat(const cv::cuda::GpuMat &)
'

这是 Eclipse C++ 解析中的错误,字段为 bug 550397

更新:我也有一个修复程序。