[LLVMbugs] [Bug 6507] New: Forwarding 0 as a pointer using rvalue references doesn't work

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 5 01:02:16 PST 2010


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

           Summary: Forwarding 0 as a pointer using rvalue references
                    doesn't work
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P5
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ahmedcharles at gmail.com
                CC: llvmbugs at cs.uiuc.edu


std::pair in c++0x has additional constructor overloads which take rvalue
references and forward them to the stored type's constructors. Rvalue
references forward 0 as an int rather than as a pointer. nullptr can be used to
solve this problem, but since that is not universally supported,
static_cast'ing the 0 to the expected pointer type is sufficient.

lib/CodeGen/SelectionDAG/TargetLowering.cpp:2402
lib/CodeGen/SelectionDAG/TargetLowering.cpp:2434
lib/Transforms/Utils/PromoteMemoryToRegister.cpp:864

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list