This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/77990] New: unique_ptr<T, D>::unique_ptr(T*) imposes CopyConstructible on the deleter


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]