首页 > 解决方案 > 如何更改 unit_test/修复纯函数错误

问题描述

/usr/include/boost/test/auto_unit_test.hpp:17:1: note: #pragma message: This header is deprecated. Use This header is deprecated. Please use <boost/test/unit_test.hpp> instead. instead.
17 | BOOST_HEADER_DEPRECATED( "This header is deprecated. Please use <boost/test/unit_test.hpp> instead." )
  | ^~~~~~~~~~~~~~~~~~~~~~~
       [C++] jml/arch/simd_vector.cc
./jml/arch/simd_vector.cc:46:61: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes]
   46 | void vec_scale(const float * x, float k, float * r, size_t n)
  |                                                             ^
cc1plus: all warnings being treated as errors

制作:*** [jml/arch//arch.mk:27: build/x86_64/obj/jml/arch/simd_vector.894c3fd093070a25659bff4e67647992.lo] 错误

另外:/jml/arch/fslock.cc:23:18:错误:命名空间“std”中的“函数”未命名模板类型 23 | typedef std::function<void ()> Fn; | ^~~~~~~~ ./jml/arch/fslock.cc:14:1: 注意: 'std::function' 定义在头文件''; 你忘了'#include'吗?13 | #include "fslock.h" +++ |+#include 14 | ./jml/arch/fslock.cc:25:22:错误:'Fn' 未命名类型 25 | Call_Guard(const Fn & fn) | ^~ ./jml/arch/fslock.cc:36:5: 错误:'Fn' 没有命名类型 36 | Fn fn_; | ^~ ./jml/arch/fslock.cc: 在构造函数'{anonymous}::Call_Guard::Call_Guard(const int&)': ./jml/arch/fslock.cc:26:11: 错误:类'{anonymous }::Call_Guard' 没有
任何名为“fn_”的字段 26 | : fn_(fn) | ^~~ ./jml/arch/fslock.cc:在析构函数“{anonymous}::Call_Guard::~Call_Guard()”中:./jml/arch/fslock.cc:32:13:错误:“fn_”是未在此范围内声明 32 | 如果(fn_)fn_();|

标签: c++

解决方案


推荐阅读