r264399 - in /trunk/libstdc++-v3: ChangeLog inc...
redi@gcc.gnu.org
redi@gcc.gnu.org
Tue Sep 18 16:05:00 GMT 2018
Author: redi
Date: Tue Sep 18 16:05:36 2018
New Revision: 264399
URL: https://gcc.gnu.org/viewcvs?rev=264399&root=gcc&view=rev
Log:
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.
Added:
trunk/libstdc++-v3/testsuite/20_util/unique_ptr/requirements/incomplete.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/unique_ptr.h
More information about the Gcc-cvs
mailing list