[Bug 282513] math/openfst-vosk: fix build with clang and libc++ 19

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 03 Nov 2024 11:47:23 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282513

            Bug ID: 282513
           Summary: math/openfst-vosk: fix build with clang and libc++ 19
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: yuri@freebsd.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(yuri@freebsd.org)
          Assignee: yuri@freebsd.org

With clang and libc++ 19 math/openfst-vosk fails to compile, with errors
similar to:

  ./../include/fst/fst.h:704:15: error: no viable overloaded '='
    704 |     isymbols_ = impl.isymbols_ ? impl.isymbols_->Copy() : nullptr;
        |     ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/c++/v1/__memory/unique_ptr.h:231:67: note: candidate function
not viable: no known conversion from 'SymbolTable *' to
'unique_ptr<SymbolTable>' for 1st argument
    231 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr&
operator=(unique_ptr&& __u) _NOEXCEPT {
        |                                                                   ^  
      ~~~~~~~~~~~~~~~~
  /usr/include/c++/v1/__memory/unique_ptr.h:241:67: note: candidate template
ignored: could not match 'unique_ptr<_Up, _Ep>' against 'SymbolTable *'
    241 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr&
operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
        |                                                                   ^
  /usr/include/c++/v1/__memory/unique_ptr.h:263:67: note: candidate function
not viable: no known conversion from 'SymbolTable *' to 'nullptr_t' (aka
'std::nullptr_t') for 1st argument
    263 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unique_ptr&
operator=(nullptr_t) _NOEXCEPT {
        |                                                                   ^  
      ~~~~~~~~~
  /usr/include/c++/v1/__memory/unique_ptr.h:138:59: note: candidate function
(the implicit copy assignment operator) not viable: no known conversion from
'SymbolTable *' to 'const unique_ptr<SymbolTable>' for 1st argument
    138 | class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr
{
        |                                                           ^~~~~~~~~~

and:

  ./../include/fst/bi-table.h:330:25: error: no member named 's_' in
'VectorHashBiTable<I, T, S, FP, H, HS>'
    330 |       : selector_(table.s_),
        |                   ~~~~~ ^

The first error can be fixed by using `std::unique_ptr<>::reset` instead
of the assignment operator. The second error can be fixed by using the
correct class member, `selector_`.

-- 
You are receiving this mail because:
You are the assignee for the bug.