https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126120

--- Comment #3 from winapiadmin <asdfsddf1 at outlook dot com> ---
Comment on attachment 64997
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64997
A possible patch for the library (maybe, verify the diffs)

>--- a/libstdc++-v3/include/bits/shared_ptr_base.h
>+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
>@@ -1526,17 +1526,16 @@
>-      template<typename _Yp, typename _Deleter, typename = _SafeConv<_Yp>>
>+      template<typename _Yp, typename _Deleter, typename = _SafeConv<_Yp>, 
>typename = typename enable_if<__is_invocable<_Deleter&, _Yp*&>::value>::type>
>       __shared_ptr(_Yp* __p, _Deleter __d)
>       : _M_ptr(__p), _M_refcount(__p, std::move(__d))
>       {
>-        static_assert(__is_invocable<_Deleter&, _Yp*&>::value,
>-            "deleter expression d(p) is well-formed");
>         _M_enable_shared_from_this_with(__p);
>       }
> 
>       template<typename _Yp, typename _Deleter, typename _Alloc,
>-             typename = _SafeConv<_Yp>>
>+               typename = _SafeConv<_Yp>, 
>+               typename = typename enable_if<__is_invocable<_Deleter&, 
>_Yp*&>::value>::type>
>         __shared_ptr(_Yp* __p, _Deleter __d, _Alloc __a)
>         : _M_ptr(__p), _M_refcount(__p, std::move(__d), std::move(__a))
>         {
>-           static_assert(__is_invocable<_Deleter&, _Yp*&>::value,
>-               "deleter expression d(p) is well-formed");
>           _M_enable_shared_from_this_with(__p);
>         }

Reply via email to