This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/77990] New: unique_ptr<T, D>::unique_ptr(T*) imposes CopyConstructible on the deleter
- From: "evansr at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Oct 2016 19:35:19 +0000
- Subject: [Bug libstdc++/77990] New: unique_ptr<T, D>::unique_ptr(T*) imposes CopyConstructible on the deleter
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77990
Bug ID: 77990
Summary: unique_ptr<T, D>::unique_ptr(T*) imposes
CopyConstructible on the deleter
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: evansr at google dot com
CC: brooks at gcc dot gnu.org
Target Milestone: ---
Created attachment 39815
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39815&action=edit
test case
C++11 spec [unique.ptr.single.ctor] says:
For unique_ptr<T, D> the ctor overload:
explicit unique_ptr(pointer p);
Requires: D shall satisfy DefaultConstructible.
The current libstdc++ implementation imposes CopyConstructible because it
constructs the _M_t data member tuple as _M_t(__p, deleter_type()).
See:
https://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/include/bits/unique_ptr.h?revision=237531&view=markup#l171