[LLVMbugs] [Bug 15319] New: Objective-C++ @encode() behaves incorrectly for nullptr_t

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 21 02:50:58 PST 2013


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

            Bug ID: 15319
           Summary: Objective-C++ @encode() behaves incorrectly for
                    nullptr_t
           Product: clang
           Version: 3.2
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bugzilla.llvm.j at ayton.se
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10050
  --> http://llvm.org/bugs/attachment.cgi?id=10050&action=edit
Trivial test

Actual version: Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)

In Objective-C++ and C++11 mode, @encode(std::nullptr_t) produces "i", which is
conceptually wrong and also implies the wrong size on LP64 platforms. A more
logical encoding would be "^?" or "^v". I assume this is an oversight, but if
there is some reason to use an integer encoding it should be "l".

The output of the attached test case on 64-bit OS X is:
    std::nullptr_t: "i" - 8 bytes
    int: "i" - 4 bytes
    void *: "^v" - 8 bytes

With libc++ in C++98 mode, the output is:
    std::nullptr_t: "{nullptr_t=^v}" - 8 bytes
    int: "i" - 4 bytes
    void *: "^v" - 8 bytes

-- 
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/20130221/f1c15a93/attachment.html>


More information about the llvm-bugs mailing list