[LLVMbugs] [Bug 22636] Generated code crashes in -O2/-O3 because of template expansion
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Feb 19 14:41:05 PST 2015
http://llvm.org/bugs/show_bug.cgi?id=22636
Hal Finkel <hfinkel at anl.gov> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Hal Finkel <hfinkel at anl.gov> ---
Unfortunately, the source code provided is not valid. Specifically, binding a
null pointer to a reference in C++ produces undefined behavior. GCC does not
take advantage of this fact, but Clang does.
There was a note about this in the Clang 3.5 release notes. It says:
C++ Language Changes in Clang
-----------------------------
- Reference parameters and return values from functions are more aggressively
assumed to refer to valid objects when optimizing. Clang will attempt to
issue a warning by default if it sees null checks being performed on
references, and `-fsanitize=null` can be used to detect null references
being formed at runtime.
--
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/20150219/8fe966b2/attachment.html>
More information about the llvm-bugs
mailing list