[LLVMbugs] [Bug 20616] New: shared_ptr does not compile with fancy pointer allocators

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 11 08:04:55 PDT 2014


            Bug ID: 20616
           Summary: shared_ptr does not compile with fancy pointer
           Product: libc++
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tkoeppe at google.com
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    Classification: Unclassified

The implementation of allocate_shared currently assumes that
allocator_traits<_Alloc>::pointer is a native pointer, and thus doesn't compile
with fancy pointers.

I believe all that's needed is to replace "__hold2.get()" by
"_VSTD::addressof(*__hold2.get())" in a few places (e.g. memory:4289 and
memory:4292, maybe also for the _LIBCPP_HAS_NO_VARIADICS versions.

A few quick tests suggest that with those fixes you can use allocate_shared and
also the allocator constructor with fancy pointer allocators.

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/20140811/ef6e9748/attachment.html>

More information about the llvm-bugs mailing list