From fc74ff5a0792641885551a63d9ddf8cbfdf76e3c Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 6 Jan 2016 20:02:26 +0000 Subject: Vendor import of clang trunk r256945: https://llvm.org/svn/llvm-project/cfe/trunk@256945 --- lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/StaticAnalyzer/Core/BugReporterVisitors.cpp') diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index ec1310d..cf1e0a6 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -1542,6 +1542,16 @@ LikelyFalsePositiveSuppressionBRVisitor::getEndPath(BugReporterContext &BRC, } } + // The analyzer issues a false positive when the constructor of + // std::__independent_bits_engine from algorithms is used. + if (const CXXConstructorDecl *MD = dyn_cast(D)) { + const CXXRecordDecl *CD = MD->getParent(); + if (CD->getName() == "__independent_bits_engine") { + BR.markInvalid(getTag(), nullptr); + return nullptr; + } + } + // The analyzer issues a false positive on // std::basic_string v; v.push_back(1); // and -- cgit v1.1