]> granicus.if.org Git - clang/commitdiff
Handle base and member destructors in CheckFallThrough.
authorAnders Carlsson <andersca@mac.com>
Mon, 17 Jan 2011 19:06:31 +0000 (19:06 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 17 Jan 2011 19:06:31 +0000 (19:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123667 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/AnalysisBasedWarnings.cpp
test/SemaCXX/warn-missing-noreturn.cpp

index 3ded735f592b41a25a653138cca4851fcc70d265..4463d3fea53a4d724832969a227ac7482ca5b484 100644 (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;
index 251117fb77411fcce336a47e521b02109e50bc54..54485fb5b1496fdd1a5475732b9a5543e3e74b2b 100644 (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() { }
+  };
 }