[llvm-bugs] [Bug 32147] New: shared_ptr's converting ctor from unique_ptr is incorrectly constrained.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Mar 5 17:30:22 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=32147

            Bug ID: 32147
           Summary: shared_ptr's converting ctor from unique_ptr is
                    incorrectly constrained.
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eric at efcs.ca
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Libc++ incorrectly rejects the following code.

Reproducer from stack overflow:

// clang++ -std=c++14 test.cpp
#include <memory>

int main() {
    auto up = std::unique_ptr<int[]>(new int[5]{});
    auto sp = std::shared_ptr<int>(std::move(up));
}

I'm not yet 100% sure this is the behavior required be the C++17 standard, but
It needs to be investigated and libc++ is most likely wrong.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170306/bd09ba47/attachment.html>


More information about the llvm-bugs mailing list