]> granicus.if.org Git - clang/commitdiff
In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more than...
authorAnders Carlsson <andersca@mac.com>
Wed, 9 Dec 2009 04:26:02 +0000 (04:26 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 9 Dec 2009 04:26:02 +0000 (04:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90948 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/CXXInheritance.cpp
test/SemaCXX/using-decl-1.cpp

index e5300f82847fa205796ae147828a9162bbbda3a2..92a58b76d87803a9074996898055df073183d1c5 100644 (file)
@@ -117,14 +117,16 @@ bool CXXRecordDecl::forallBases(ForallBasesCallback *BaseMatches,
         continue;
       }
 
-      RecordDecl *Base = Ty->getDecl()->getDefinition(Context);
+      CXXRecordDecl *Base = 
+            cast_or_null<CXXRecordDecl>(Ty->getDecl()->getDefinition(Context));
       if (!Base) {
         if (AllowShortCircuit) return false;
         AllMatches = false;
         continue;
       }
       
-      if (!BaseMatches(cast<CXXRecordDecl>(Base), OpaqueData)) {
+      Queue.push_back(Base);
+      if (!BaseMatches(Base, OpaqueData)) {
         if (AllowShortCircuit) return false;
         AllMatches = false;
         continue;
index 42deb27027bf5d0f0d826b99054f7636c0012ef8..0235624a8ea5eeba1db1bee460ef4b87e724ce5c 100644 (file)
@@ -38,3 +38,7 @@ struct X1 : X0 {
     (*this)(1);
   }
 };
+
+struct A { void f(); };
+struct B : A { };
+class C : B { using B::f; };