[llvm-bugs] [Bug 11876] missed null dereference warning
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed May 18 15:53:39 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=11876
Nick Lewycky <nlewycky at google.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |nlewycky at google.com
Resolution|--- |FIXED
--- Comment #1 from Nick Lewycky <nlewycky at google.com> ---
All better!
pr11876.cc:3:8: 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]
if (&obj == 0) return 0;
^~~ ~
pr11876.cc:7:7: warning: binding dereferenced null pointer to reference has
undefined behavior [-Wnull-dereference]
foo(*(Cls*)0);
^~~~~~~~
2 warnings generated.
--
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/20160518/843b8b1a/attachment.html>
More information about the llvm-bugs
mailing list