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 c++/77987] New: unique_ptr<T[]> reset rejects cv-compatible pointers


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

            Bug ID: 77987
           Summary: unique_ptr<T[]> reset rejects cv-compatible pointers
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

#include <memory>

int main() {
    std::unique_ptr<const char[]> p;
    p.reset(new char[1]);
}

fails to compile with due to reset invoking swap on two different types.
However, this code should be well-formed per N4089.

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