diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2018-09-18 17:05:36 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2018-09-18 17:05:36 +0100 |
commit | a12c16de529755cdf4dbc594dd48742107ad349e (patch) | |
tree | 972c09ab072dd40014d9173255ca43195237a020 /gcc | |
parent | f96c8666f57e89182c3b0661f2e5e19f8b70aa8a (diff) | |
download | gcc-a12c16de529755cdf4dbc594dd48742107ad349e.zip gcc-a12c16de529755cdf4dbc594dd48742107ad349e.tar.gz gcc-a12c16de529755cdf4dbc594dd48742107ad349e.tar.bz2 |
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
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions