This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77987] New: unique_ptr<T[]> reset rejects cv-compatible pointers
- From: "barry.revzin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Oct 2016 17:34:40 +0000
- Subject: [Bug c++/77987] New: unique_ptr<T[]> reset rejects cv-compatible pointers
- Auto-submitted: auto-generated
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.