<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:rtrieu@google.com" title="rtrieu@google.com">rtrieu@google.com</a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Warn user about comparision of reference to nullptr"
href="http://llvm.org/bugs/show_bug.cgi?id=19899">bug 19899</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 - Warn user about comparision of reference to nullptr"
href="http://llvm.org/bugs/show_bug.cgi?id=19899#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Warn user about comparision of reference to nullptr"
href="http://llvm.org/bugs/show_bug.cgi?id=19899">bug 19899</a>
from <span class="vcard"><a class="email" href="mailto:rtrieu@google.com" title="rtrieu@google.com">rtrieu@google.com</a>
</span></b>
<pre>Committed in r210372
$ cat PR19899.cc
bool foo(int &x) { return &x == 0; }
struct S { bool f() { return this == nullptr; } };
$ clang -fsyntax-only PR19899.cc -std=c++11
PR19899.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; }
^ ~
PR19899.cc:2:30: warning: 'this' pointer cannot be null in well-defined C++
code; comparison may be assumed to always evaluate to false
[-Wtautological-undefined-compare]
struct S { bool f() { return this == nullptr; } };
^~~~ ~~~~~~~
2 warnings generated.</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>