Fix location of invocable check for unique_ptr deleter
The deleter only needs to be invocable when the unique_ptr destructor and reset member function are instantiated. In other contexts it might not be possible to pass unique_ptr<T, D>::pointer to the deleter, if that requires a derived-to-base conversion from T* and T is incomplete. * include/bits/unique_ptr.h (__uniq_ptr_impl): Remove static assertion checking invocable condition. (unique_ptr::~unique_ptr, unique_ptr::reset): Restore static assertion here, where types must be complete. Pass pointer to deleter as an rvalue. * testsuite/20_util/unique_ptr/requirements/incomplete.cc: New test. From-SVN: r264399
Showing
Please
register
or
sign in
to comment