diff options
author | Anna Zaks <ganna@apple.com> | 2013-11-04 19:13:03 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-11-04 19:13:03 +0000 |
commit | 830d2f7701a25b1514bff01dc39b7a3420a63de2 (patch) | |
tree | 7f3aaad8d96cfb0d748edc7cef23e5319877c7fd /clang/lib | |
parent | 5efbc6379eea695b472ac246133bb99d23b9d9bb (diff) | |
download | bcm5719-llvm-830d2f7701a25b1514bff01dc39b7a3420a63de2.tar.gz bcm5719-llvm-830d2f7701a25b1514bff01dc39b7a3420a63de2.zip |
[analyzer] Suppress warnings coming out of std::basic_string.
The analyzer cannot reason about the internal invariances of the data structure (radar://15194597).
llvm-svn: 194004
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index aaec658e06f..2aa65fd6d4b 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -1549,6 +1549,18 @@ LikelyFalsePositiveSuppressionBRVisitor::getEndPath(BugReporterContext &BRC, return 0; } } + // The analyzer issues a false positive on + // std::basic_string<uint8_t> v; v.push_back(1); + // because we cannot reason about the internal invariants of the + // datastructure. + if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) { + const CXXRecordDecl *CD = MD->getParent(); + if (CD->getName() == "basic_string") { + BR.markInvalid(getTag(), 0); + return 0; + } + } + } } |