]> granicus.if.org Git - clang/commit
[analyzer] PR41269: Add a bit of C++ smart pointer modeling.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 23 Apr 2019 02:45:42 +0000 (02:45 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 23 Apr 2019 02:45:42 +0000 (02:45 +0000)
commitd568cd71389d81e358fb18d99879c4d76d9dd4ae
tree831428fc15eadb33d972d150e2291b3d3b1488be
parent02a417f69b3e03dc54a63ac321e31ed5af80f7e7
[analyzer] PR41269: Add a bit of C++ smart pointer modeling.

Implement cplusplus.SmartPtrModeling, a new checker that doesn't
emit any warnings but models methods of smart pointers more precisely.

For now the only thing it does is make `(bool) P` return false when `P`
is a freshly moved pointer. This addresses a false positive in the
use-after-move-checker.

Differential Revision: https://reviews.llvm.org/D60796

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358944 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
lib/StaticAnalyzer/Checkers/Move.h [new file with mode: 0644]
lib/StaticAnalyzer/Checkers/MoveChecker.cpp
lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp [new file with mode: 0644]
test/Analysis/Inputs/system-header-simulator-cxx.h
test/Analysis/smart-ptr.cpp [new file with mode: 0644]
test/Analysis/use-after-move.cpp