Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Jan 2024 21:26:44 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 276187] devel/cpprestsdk: json.h breaks with the FreeBSD std::unique_ptr
Message-ID:  <bug-276187-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276187

            Bug ID: 276187
           Summary: devel/cpprestsdk: json.h breaks with the FreeBSD
                    std::unique_ptr
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: sigsegv@radiotube.org

Created attachment 247517
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D247517&action=
=3Dedit
Patch files to de-inline the failing constructor and destructor

A simple #include <cpprestsdk/json.h> fails with errors like this:

In file included from /usr/include/c++/v1/iostream:43:
In file included from /usr/include/c++/v1/ios:221:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:191:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31:
/usr/include/c++/v1/__memory/unique_ptr.h:63:19: error: invalid application=
 of
'sizeof' to an incomplete type 'web::json::details::_Value'
    static_assert(sizeof(_Tp) >=3D 0, "cannot delete an incomplete type");
                  ^~~~~~~~~~~
/usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of
member function 'std::default_delete<web::json::details::_Value>::operator(=
)'
requested here
      __ptr_.second()(__tmp);
      ^
/usr/include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of
member function 'std::unique_ptr<web::json::details::_Value>::reset' reques=
ted
here
  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() {
reset(); }
                                                                          ^
/usr/local/include/cpprest/json.h:716:14: note: in instantiation of member
function 'std::unique_ptr<web::json::details::_Value>::~unique_ptr' request=
ed
here
    explicit value(std::unique_ptr<details::_Value> v) : m_value(std::move(=
v))
             ^
/usr/local/include/cpprest/json.h:35:7: note: forward declaration of
'web::json::details::_Value'
class _Value;
      ^
1 error generated.

Suggested patch included. De-inlining the constructor and destructor makes =
the
sizeof(_Value) available to std::unique_ptr.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-276187-7788>