[llvm-bugs] [Bug 25770] New: Analyzer misses dangling reference
llvm-bugs at lists.llvm.org
Tue Dec 8 05:57:53 PST 2015
Bug ID: 25770
Summary: Analyzer misses dangling reference
Component: Static Analyzer
Assignee: kremenek at apple.com
Reporter: t at sharklasers.com
CC: llvm-bugs at lists.llvm.org
Created attachment 15412
Code demonstrating the bug
The code produces a temporary unique_ptr that is dereferenced to obtain a
const& to the managed heap allocated object. unique_ptr is destroyed, deletes
the object and the reference is left dangling.
$ scan-build g++ -std=c++1z dangling_ref.cpp
scan-build: Using 'local/tmp/clang/bin/clang' for static analysis
scan-build: Removing directory '/tmp/scan-build-2015-12-08-145243-7071-1'
because it contains no reports.
scan-build: No bugs found.
Example taken from the talk "CppCon 2015: Herb Sutter "Writing Good C++14... By
Default" at 44:04 (a Microsoft static analysis tool was demonstrated that is
supposedly able to catch this bug)
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs