summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2015-11-18 22:46:52 +0000
committerDevin Coughlin <dcoughlin@apple.com>2015-11-18 22:46:52 +0000
commit6e644abd46ec6f339e6e639e30566816e75694a7 (patch)
tree758c47963bd0eb0eac5a5c81ac302a1d3bfdd556 /clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
parentcfb1456572949abcbe1769c5c272ce1f397db883 (diff)
downloadbcm5719-llvm-6e644abd46ec6f339e6e639e30566816e75694a7.tar.gz
bcm5719-llvm-6e644abd46ec6f339e6e639e30566816e75694a7.zip
[analyzer] Skip checking blocks in dependent contexts.
Since we don't check functions in dependent contexts, we should skip blocks in those contexts as well. This avoids an assertion failure when the DeadStoresChecker attempts to evaluate an array subscript expression with a dependent name type. rdar://problem/23564220 llvm-svn: 253516
Diffstat (limited to 'clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
index ca92ffe8f01..bbcd23c8a25 100644
--- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -368,7 +368,11 @@ public:
bool VisitBlockDecl(BlockDecl *BD) {
if (BD->hasBody()) {
assert(RecVisitorMode == AM_Syntax || Mgr->shouldInlineCall() == false);
- HandleCode(BD, RecVisitorMode);
+ // Since we skip function template definitions, we should skip blocks
+ // declared in those functions as well.
+ if (!BD->isDependentContext()) {
+ HandleCode(BD, RecVisitorMode);
+ }
}
return true;
}
OpenPOWER on IntegriCloud