<html>
<head>
<base href="https://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 --- - operator<(std::nullptr_t, std::nullptr_t) should be allowed"
href="https://llvm.org/bugs/show_bug.cgi?id=31820">31820</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>operator<(std::nullptr_t, std::nullptr_t) should be allowed
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>4.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jared.grubb@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Recently, Richard Smith made a change to address two DR's:
Commit:
<a href="https://github.com/llvm-mirror/clang/commit/c1d70e9b5c41fdb4c565638715a03a83503b7fae">https://github.com/llvm-mirror/clang/commit/c1d70e9b5c41fdb4c565638715a03a83503b7fae</a>
The gist of the patch was to disallow "nullptr < p", which I agree makes sense.
However, when p is actually std::nullptr_t, then it is now a compiler error,
and I don't agree with this.
std::nullptr_t should be a regular type in all the Stepanov ways unless there's
a good reason to disallow it. I don't see why the std::nullptr_t should not be
totally ordered (in the trivial way).
This is not a theoretical problem because it did break a line of code in a JSON
library that I use. It was easy to work around but I dont think the code should
be disallowed:
<a href="https://github.com/dropbox/json11/blob/master/json11.cpp#L166">https://github.com/dropbox/json11/blob/master/json11.cpp#L166</a>
Here, the code ends up trying to do "this->m_value < other.m_value" where both
members are std::nullptr_t (in the implementation for Value<tag,
std::nullptr_t>).
I would like to ask that libc++ put back the overload to make "nullptr <
nullptr" allowed as an extension. GCC and MSVC both allow this, and clang did
until the latest version.</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>