<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Objective-C++ @encode() behaves incorrectly for nullptr_t"
href="http://llvm.org/bugs/show_bug.cgi?id=15319">15319</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Objective-C++ @encode() behaves incorrectly for nullptr_t
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bugzilla.llvm.j@ayton.se
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=10050" name="attach_10050" title="Trivial test">attachment 10050</a> <a href="attachment.cgi?id=10050&action=edit" title="Trivial test">[details]</a></span>
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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>