libstdc++: Implement std::make_unique_for_overwrite
authorJonathan Wakely <jwakely@redhat.com>
Mon, 19 Oct 2020 21:11:39 +0000 (22:11 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 19 Oct 2020 21:11:39 +0000 (22:11 +0100)
commite7a0af84d68f50b65dffa1af462d10bd4bf03939
treead0aa318c41652ae2c9a474134733f37331316e3
parentbadeac77f55276d047b3cc202e4ddd49ba643d8a
libstdc++: Implement std::make_unique_for_overwrite

This is the std::unique_ptr part of P1020R1 (as amended by P1973R1) for
C++20. The std::shared_ptr part still needs to be done.

libstdc++-v3/ChangeLog:

* include/bits/unique_ptr.h (make_unique_for_overwrite): Define
for C++20.
* testsuite/20_util/unique_ptr/creation/array_neg.cc: Remove
unused header. Adjust standard reference.
* testsuite/20_util/unique_ptr/creation/for_overwrite.cc: New test.
* testsuite/20_util/unique_ptr/creation/for_overwrite__neg.cc: New test.
libstdc++-v3/include/bits/unique_ptr.h
libstdc++-v3/testsuite/20_util/unique_ptr/creation/array_neg.cc
libstdc++-v3/testsuite/20_util/unique_ptr/creation/for_overwrite.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/unique_ptr/creation/for_overwrite__neg.cc [new file with mode: 0644]