奇怪的stdlib(memory.h)问题,make_shared专属于xcode apple clang
Strange stdlib(memory.h) issues with make_shared exclusive to xcode apple clang
我有奇怪的问题,只出现在OSX上。(它可以在windows上使用visual studio和linux上使用gcc和clang)/在我的代码中,我有这样的东西:
std::shared_ptr<mythread> ptr = std::make_shared<mythread>(name)
mythread派生自一个没有except(false)析构函数和一些基本结构的类。
apple clang抱怨:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3686:7: error: exception specification of overriding function is more lax than base version
class __shared_ptr_emplace
跳过实例化/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3616:13: note: overridden virtual function is here
virtual ~__shared_weak_count();
如何修复这个错误,为什么它出现(仅在osx上)?我在clang中发现了一些类似的bug,但它们应该在2011年被修复。
显然由于某种原因,它不喜欢在父类的析构函数中使用noexcept(false)。无法用连贯的方式来表达。
- VS Code "command":"make"与终端窗口中的命令行"make"不同
- 使用 make 编译 MPI,几个命名空间错误,例如"错误:未知类型名称'使用'?
- make 命令如何避免重新编译未更改的源文件?
- MAKE:找不到包含的用户定义的头文件?
- 'make check' GLIBC 运行时的链接问题
- 引用 std::shared:ptr 以避免引用计数
- Qt5 [make -snap] 无法正确编译:进程"/usr/bin/snap"代码 1 退出
- mingw32-make 使用"MinGW Makefiles"生成器跟踪 CMAKE 无法将可执行文件链接到对象库
- make 命令创建 .file,但不创建应用程序文件
- 如何摆脱导入的 make 项目中的 Eclipse 索引器"Type std::... could not be resolved"错误
- Qt Creator 在执行步骤 "make" 时出现编译错误,-fno-stack-limit
- 如何使用MySQL Connector and Make设置C++项目
- 使用 make 将对象文件放在特定目录中
- 我是 C++ 的新手,我试图调用 make 一个以 2 个类作为其参数的类构造函数
- "Make"失败并出现 Clang 错误 - 如何从 Clang 获得错误?
- dopen():不以 root 身份运行时"failed to map segment from shared object"
- 防止 GNU Make 在每次构建时生成 protobuf 代码
- Make zmqpp::socket::connect a std::future
- 链接从命令行转换为Make的库
- 将 make 和 cmake 合并到构建系统中