[cfe-commits] r123667 - in /cfe/trunk: lib/Sema/AnalysisBasedWarnings.cpp test/SemaCXX/warn-missing-noreturn.cpp
Anders Carlsson
andersca at mac.com
Mon Jan 17 11:06:31 PST 2011
Author: andersca
Date: Mon Jan 17 13:06:31 2011
New Revision: 123667
URL: http://llvm.org/viewvc/llvm-project?rev=123667&view=rev
Log:
Handle base and member destructors in CheckFallThrough.
Modified:
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=123667&r1=123666&r2=123667&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Mon Jan 17 13:06:31 2011
@@ -136,7 +136,16 @@
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;
Modified: cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp?rev=123667&r1=123666&r2=123667&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp Mon Jan 17 13:06:31 2011
@@ -65,5 +65,20 @@
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() { }
+ };
}
More information about the cfe-commits
mailing list