PR libstdc++/87704 fix unique_ptr(nullptr_t) constructors
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Oct 2018 13:10:26 +0000 (14:10 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 23 Oct 2018 13:10:26 +0000 (14:10 +0100)
commitc3ba63c314d61362f7c48c4feeefa13ea3978344
tree3c251d913f928aff73255661bf886c61668373ac
parent99c24b911b385a3dddfe8fe5730d2c659a92222a
PR libstdc++/87704 fix unique_ptr(nullptr_t) constructors

Using a delegating constructor to implement these constructors means
that they instantiate the destructor, which requires the element_type to
be complete. In C++11 and C++14 they were specified to be delegating,
but that was changed as part of LWG 2801 so in C++17 they don't require
a complete type (as was intended all along).

PR libstdc++/87704
* include/bits/unique_ptr.h (unique_ptr::unique_ptr(nullptr_t)): Do
not delegate to default constructor.
(unique_ptr<T[], D>::unique_ptr(nullptr_t)): Likewise.
* testsuite/20_util/unique_ptr/cons/incomplete.cc: New test.

From-SVN: r265423
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/unique_ptr.h
libstdc++-v3/testsuite/20_util/unique_ptr/cons/incomplete.cc [new file with mode: 0644]