https://bugs.llvm.org/show_bug.cgi?id=39363
Bug ID: 39363
Summary: Cannot construct unique_ptr with pointer to incomplete
type
Product: libc++
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: ztur...@google.com
CC: e...@efcs.ca, llvm-bugs@lists.llvm.org,
mclow.li...@gmail.com, mc...@qti.qualcomm.com
https://godbolt.org/z/a8ml4u
#include <memory>
struct foo;
struct bar
{
// ok
std::unique_ptr<foo> a;
// ok
std::unique_ptr<foo> b{};
// not ok
std::unique_ptr<foo> c{nullptr};
};
According to http://eel.is/c++draft/unique.ptr#4.sentence-3, it should be ok
for the type to be incomplete. Since this is construction and not assignment,
it is not necessary to call delete and so we don't need to do a reset, hence we
shouldn't yet require a complete type.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs