gnustl (libstdc++) to llvm (libc++ ) errors

gnustl (libstdc++) to llvm (libc++ ) errors

本文关键字:libc++ errors llvm to gnustl libstdc++      更新时间:2023-10-16

我从gnustl迁移到libc++后开始出现这些错误。我在互联网上找不到任何关于此的内容。并且没有任何更多信息。我正在继续对此进行调查,随着调查的进行,我将用我的发现更新此线程。

f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++include__tree(1819,22) :  error: the specified comparator type does not provide a const call operator [-Werror,-Wuser-defined-warnings]
                     __trigger_diagnostics()), "");
                     ^
f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++includeset(400,28) :  note: in instantiation of member function 'std::__ndk1::__tree<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> >::~__tree' requested here
class _LIBCPP_TEMPLATE_VIS set
                           ^
f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++includememory(1550,14) :  note: in instantiation of function template specialization 'std::__ndk1::allocator_traits<HeapAllocator<std::__ndk1::__tree_node<std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > >, void *> > >::__destroy<std::__ndk1::pair<RichValueTypeReservedKeyInfoManager *const, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > > >' requested here
            {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}
             ^
f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++include__tree(1833,24) :  note: in instantiation of function template specialization 'std::__ndk1::allocator_traits<HeapAllocator<std::__ndk1::__tree_node<std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > >, void *> > >::destroy<std::__ndk1::pair<RichValueTypeReservedKeyInfoManager *const, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > > >' requested here
        __node_traits::destroy(__na, _NodeTypes::__get_ptr(__nd->__value_));
                       ^
f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++include__tree(1821,3) :  note: in instantiation of member function 'std::__ndk1::__tree<std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > >, std::__ndk1::__map_value_compare<RichValueTypeReservedKeyInfoManager *, std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > >, std::__ndk1::less<RichValueTypeReservedKeyInfoManager *>, true>, HeapAllocator<std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > > > >::destroy' requested here
  destroy(__root());
  ^
f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++includemap(805,28) :  note: in instantiation of member function 'std::__ndk1::__tree<std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > >, std::__ndk1::__map_value_compare<RichValueTypeReservedKeyInfoManager *, std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > >, std::__ndk1::less<RichValueTypeReservedKeyInfoManager *>, true>, HeapAllocator<std::__ndk1::__value_type<RichValueTypeReservedKeyInfoManager *, Set<IRichValue::Type, IRichValueUtil::TypeComparer, HeapAllocator<IRichValue::Type> > > > >::~__tree' requested here
class _LIBCPP_TEMPLATE_VIS map
                           ^
f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++include__tree(970,7) :  note: from 'diagnose_if' attribute on '__trigger_diagnostics':
      _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
      ^                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f:/nugetcacheandroidndk.16.1.9sourcescxx-stlllvm-libc++include__config(1101,20) :  note: expanded from macro '_LIBCPP_DIAGNOSE_WARNING'
    __attribute__((diagnose_if(__VA_ARGS__, "warning")))
                   ^           ~~~~~~~~~~~
1 error generated.
Exit code: 1

这告诉您正在将比较对象传递给具有非常量operator ()的集合或映射。

您可以修复比较运算符或关闭-Werror(这将使它成为警告而不是错误)

如果我是你,我会看看std::__ndk1::less