diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-01-25 22:50:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-01-25 22:50:47 +0000 |
commit | f39e6a388aaa2f155b46c61e655784b2473218eb (patch) | |
tree | 08715df98dcfadae77a5664eda0265cac3b56671 /lib/Sema/AnalysisBasedWarnings.cpp | |
parent | b7cd135215501a154eb4f68159f3af020783099e (diff) |
Fix regression in -Wreturn-type caused by not
handling all CFGElement kinds. While writing
the test case, it turned out that return-noreturn.cpp
wasn't actually testing anything since it has the wrong -W
flag. That uncovered another regression with
the handling of destructors marked noreturn. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r-- | lib/Sema/AnalysisBasedWarnings.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 4866c8fb3d..2f02e158cb 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -132,21 +132,12 @@ static ControlFlowKind CheckFallThrough(AnalysisContext &AC) { continue; } CFGElement CE = B[B.size()-1]; - if (CFGInitializer CI = CE.getAs<CFGInitializer>()) { - // A base or member initializer. - HasPlainEdge = true; - continue; - } - if (CFGMemberDtor MD = CE.getAs<CFGMemberDtor>()) { - // A member destructor. - HasPlainEdge = true; - continue; - } - if (CFGBaseDtor BD = CE.getAs<CFGBaseDtor>()) { - // A base destructor. + + if (!isa<CFGStmt>(CE)) { HasPlainEdge = true; continue; } + CFGStmt CS = CE.getAs<CFGStmt>(); if (!CS.isValid()) continue; |