PR libstdc++/87704 fix unique_ptr(nullptr_t) constructors
commit81f344ccface8e3740f99d03256307326bdd1c31
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Oct 2018 13:10:26 +0000 (23 13:10 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 Oct 2018 13:10:26 +0000 (23 13:10 +0000)
tree3c251d913f928aff73255661bf886c61668373ac
parente783c68e09c786108aaac16f088eefc8cc80c674
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265423 138bc75d-0d04-0410-961f-82ee72b054a4
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]