-
Implement LWG 2905 changes to constrain unique_ptr constructors · 86fc6ec9
LWG DR 2905 says that is_constructible_v<unique_ptr<P, D>, P, D const &> should be false when D is not copy constructible. This commit implements the changes from the DR and simplifies the signatures as per https://github.com/cplusplus/draft/issues/1530 * include/bits/unique_ptr.h (__uniq_ptr_impl): Add assertions to check deleter type. (unique_ptr::unique_ptr(pointer, const deleter_type&)): Add copy constructible constraint. (unique_ptr::unique_ptr(pointer, deleter_type&&)): Disable for deleters of reference type and add move constructible constraint. (unique_ptr::unique_ptr(pointer, remove_reference_t<deleter_type>&&)): Disable for deleters of non-reference type. Define as deleted. (unique_ptr<T[], D>): Likewise. * testsuite/20_util/unique_ptr/assign/48635_neg.cc: Replace dg-error directives with unstable line numbers with dg-prune-output. * testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Likewise. * testsuite/20_util/unique_ptr/cons/lwg2905.cc: New test. * testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc: Make deleter types invocable. From-SVN: r264206
Jonathan Wakely committed
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
48635.cc | Loading commit data... | |
48635_neg.cc | Loading commit data... | |
assign_neg.cc | Loading commit data... | |
cv_qual.cc | Loading commit data... | |
move.cc | Loading commit data... | |
move_array.cc | Loading commit data... | |
nullptr.cc | Loading commit data... |