[LLVMbugs] [Bug 20518] New: pointer_traits::__to_raw_pointer does not respect allocator requirements (for void operator->())

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Aug 2 05:37:47 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20518

            Bug ID: 20518
           Summary: pointer_traits::__to_raw_pointer does not respect
                    allocator requirements (for void operator->())
           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 allocator requirements say that X::pointer::operator-> only needs to work
for object pointers, not for X::void_pointer.

However, in libc++'s implementation of pointer_traits::__to_raw_pointer
(currently in memory:1051), operator->() is called regardless of the pointer
type. Thus this code does not compile if given a conforming fancy pointer whose
void specialization does not implement operator->.

(This is actually a plausible situation: A reasonable implementation would have
a base class that does not overload any accessor operators, and only provide
those implementations in non-void specializations of a derived class.)

-- 
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/20140802/cb2b40dc/attachment.html>


More information about the llvm-bugs mailing list