<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:nlewycky@google.com" title="Nick Lewycky <nlewycky@google.com>"> <span class="fn">Nick Lewycky</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Clang doesn't emit tautological-compare warning when nonnull is compared against NULL"
href="https://llvm.org/bugs/show_bug.cgi?id=13956">bug 13956</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Clang doesn't emit tautological-compare warning when nonnull is compared against NULL"
href="https://llvm.org/bugs/show_bug.cgi?id=13956#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Clang doesn't emit tautological-compare warning when nonnull is compared against NULL"
href="https://llvm.org/bugs/show_bug.cgi?id=13956">bug 13956</a>
from <span class="vcard"><a class="email" href="mailto:nlewycky@google.com" title="Nick Lewycky <nlewycky@google.com>"> <span class="fn">Nick Lewycky</span></a>
</span></b>
<pre>Looking over old bugs, these appear to be fixed!
pr13956-1.cc:3:12: warning: comparison of nonnull parameter 'x' equal to a null
pointer is 'false' on first encounter [-Wtautological-pointer-compare]
return x == NULL;
^ ~~~~
pr13956-2.cc:1:28: warning: reference cannot be bound to dereferenced null
pointer in well-defined C++ code; comparison may be assumed to always
evaluate to false [-Wtautological-undefined-compare]
bool foo(int &x) { return &x == 0; }
^ ~
The idea of __attribute__((nonnull(x))) or 'void f(__attribute__((nonnull)) int
*x);' will have to live elsewhere.</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>