[LLVMbugs] [Bug 10052] New: Comparision of pointer to Objective-C object with C++0x nullptr fails to compile

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 30 13:18:11 PDT 2011


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

           Summary: Comparision of pointer to Objective-C object with
                    C++0x nullptr fails to compile
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jonathan.sauer at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following Objective-C++ program fails to compile:

@interface NSOpenGLPixelFormat
{
}
@end

int main(int, char**)
{
    NSOpenGLPixelFormat* p = 0;
    if (p == nullptr)
        ;
}


This results in:

$ clang -x objective-c++ -std=c++0x clang.cpp
clang.cpp:9:8: error: invalid operands to binary expression
      ('NSOpenGLPixelFormat *' and 'nullptr_t')
        if (p == nullptr)


After replacing "nullptr" with "0L", the code compiles as expected.

My clang version:

$ clang --version
clang version 3.0 (trunk 131897)
Target: x86_64-apple-darwin10.7.0
Thread model: posix


C.f. the thread on cfe-dev, starting at
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-May/015350.html

-- 
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