Handle base and member destructors in CheckFallThrough.

llvm-svn: 123667
This commit is contained in:
Anders Carlsson 2011-01-17 19:06:31 +00:00
parent ee56962cc1
commit 48d7285fc6
2 changed files with 26 additions and 2 deletions

View File

@ -136,7 +136,16 @@ static ControlFlowKind CheckFallThrough(AnalysisContext &AC) {
HasPlainEdge = true;
continue;
}
if (CFGMemberDtor MD = CE.getAs<CFGMemberDtor>()) {
// A member destructor.
HasPlainEdge = true;
continue;
}
if (CFGBaseDtor BD = CE.getAs<CFGBaseDtor>()) {
// A base destructor.
HasPlainEdge = true;
continue;
}
CFGStmt CS = CE.getAs<CFGStmt>();
if (!CS.isValid())
continue;

View File

@ -65,5 +65,20 @@ namespace test2 {
A(char) : f(j()) { }
A(bool b) : f(b ? h() : j()) { }
};
}
namespace test3 {
struct A {
~A();
};
struct B {
~B() { }
A a;
};
struct C : A {
~C() { }
};
}