]> granicus.if.org Git - clang/commit
[analyzer] Don't inline ~shared_ptr.
authorJordan Rose <jordan_rose@apple.com>
Fri, 17 May 2013 02:16:49 +0000 (02:16 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 17 May 2013 02:16:49 +0000 (02:16 +0000)
commit50fa64d4411a42e0b4f373a84d8d4f5cbf339ea3
tree6d93b9c55c9c5be90271addac8f499b416b31c83
parentc077dbee4c5f63677390e0bd0730271d2bfa18d8
[analyzer] Don't inline ~shared_ptr.

The analyzer can't see the reference count for shared_ptr, so it doesn't
know whether a given destruction is going to delete the referenced object.
This leads to spurious leak and use-after-free warnings.

For now, just ban destructors named '~shared_ptr', which catches
std::shared_ptr, std::tr1::shared_ptr, and boost::shared_ptr.

PR15987

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182071 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
test/Analysis/NewDelete-checker-test.cpp
test/Analysis/analyzer-config.cpp