summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-11-04 19:13:03 +0000
committerAnna Zaks <ganna@apple.com>2013-11-04 19:13:03 +0000
commit830d2f7701a25b1514bff01dc39b7a3420a63de2 (patch)
tree7f3aaad8d96cfb0d748edc7cef23e5319877c7fd /clang/lib
parent5efbc6379eea695b472ac246133bb99d23b9d9bb (diff)
downloadbcm5719-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.cpp12
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;
+ }
+ }
+
}
}
OpenPOWER on IntegriCloud