forked from OSchip/llvm-project
Handle base and member destructors in CheckFallThrough.
llvm-svn: 123667
This commit is contained in:
parent
ee56962cc1
commit
48d7285fc6
|
@ -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;
|
||||
|
|
|
@ -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() { }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue