[Bug libstdc++/77987] unique_ptr<T[]> reset rejects cv-compatible pointers

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Oct 15 00:56:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77987

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Seems simple enough to fix:

@@ -608,8 +608,9 @@
                   >
                >>
       void
-      reset(_Up __p) noexcept
+      reset(_Up __ptr) noexcept
       {
+       pointer __p = __ptr;
        using std::swap;
        swap(std::get<0>(_M_t), __p);
        if (__p != nullptr)


More information about the Gcc-bugs mailing list