aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-09-11 11:55:49 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-09-11 11:55:49 +0100
commit86fc6ec9f366fd95d976c01bfa24c6775537ba62 (patch)
treece28f3d56213828fb0d7b4202d9c1940bcb5feab /gcc/gcc.c
parent9356a18eb4aa927c9e44245075b82fa0c6001789 (diff)
downloadgcc-86fc6ec9f366fd95d976c01bfa24c6775537ba62.zip
gcc-86fc6ec9f366fd95d976c01bfa24c6775537ba62.tar.gz
gcc-86fc6ec9f366fd95d976c01bfa24c6775537ba62.tar.bz2
Implement LWG 2905 changes to constrain unique_ptr constructors
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
Diffstat (limited to 'gcc/gcc.c')
0 files changed, 0 insertions, 0 deletions