[Bug libstdc++/51609] [C++11] unique_ptr<const T[]>::reset rejects cv-compatible argument pointers
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 19 02:26:00 GMT 2011
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.modifiers] to constrain the
template.
More information about the Gcc-bugs
mailing list