aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/AnalysisBasedWarnings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index 6a422242a9..84efbd50d1 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -129,12 +129,27 @@ static ControlFlowKind CheckFallThrough(AnalysisContext &AC) {
// normal. We need to look pass the destructors for the return
// statement (if it exists).
CFGBlock::const_reverse_iterator ri = B.rbegin(), re = B.rend();
+ bool hasNoReturnDtor = false;
+
for ( ; ri != re ; ++ri) {
CFGElement CE = *ri;
+
+ // FIXME: The right solution is to just sever the edges in the
+ // CFG itself.
+ if (const CFGImplicitDtor *iDtor = ri->getAs<CFGImplicitDtor>())
+ if (iDtor->isNoReturn()) {
+ hasNoReturnDtor = true;
+ HasFakeEdge = true;
+ break;
+ }
+
if (isa<CFGStmt>(CE))
break;
}
+ if (hasNoReturnDtor)
+ continue;
+
// No more CFGElements in the block?
if (ri == re) {
if (B.getTerminator() && isa<CXXTryStmt>(B.getTerminator())) {