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++/51609] [C++11] unique_ptr<const T[]>::reset rejects cv-compatible argument pointers


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51609

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-19 02:24:24 UTC ---
While I agree the code is reasonable, I think an LWG issue is needed, because I
don't think GCC's behaviour is in conflict with the standard.

I don't read [unique.ptr.runtime] p1 b2 as requiring that cv-qualified types
must be accepted.  It only says types derived from T are rejected, which GCC
does.

The standard defines exactly these overloads:

void reset(pointer p = pointer()) noexcept;
void reset(nullptr_t) noexcept;
template <class U> void reset(U) = delete;

and there is nothing in [unique.ptr.runtime.modiïers] to constrain the
template.


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