]> granicus.if.org Git - clang/commitdiff
It's OK for a pure virtual function to override another pure virtual function. Fixes...
authorAnders Carlsson <andersca@mac.com>
Sun, 18 Oct 2009 19:34:08 +0000 (19:34 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 18 Oct 2009 19:34:08 +0000 (19:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84428 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/abstract.cpp

index 419c8a13c2d4f1d0fd16b34199059d301345cb73..d2ef113b3050b67b88f2a0119b7f2330f9ea4e89 100644 (file)
@@ -1658,12 +1658,10 @@ namespace {
       // Traverse the record, looking for methods.
       if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(*i)) {
         // If the method is pure virtual, add it to the methods vector.
-        if (MD->isPure()) {
+        if (MD->isPure())
           Methods.push_back(MD);
-          continue;
-        }
 
-        // Otherwise, record all the overridden methods in our set.
+        // Record all the overridden methods in our set.
         for (CXXMethodDecl::method_iterator I = MD->begin_overridden_methods(),
              E = MD->end_overridden_methods(); I != E; ++I) {
           // Keep track of the overridden methods.
index e14304a26fe3de825d211db1db486755f6e19df4..42b8d7febe655a4c245413f586c5388588d101c9 100644 (file)
@@ -123,3 +123,18 @@ struct K {
 struct L : public K {
  void f();
 };
+
+// PR5222
+namespace PR5222 {
+  struct A {
+    virtual A *clone() = 0;
+  };
+  struct B : public A {
+    virtual B *clone() = 0;
+  };
+  struct C : public B {
+    virtual C *clone();
+  };
+
+  C c;  
+}