[cfe-commits] r90948 - in /cfe/trunk: lib/AST/CXXInheritance.cpp test/SemaCXX/using-decl-1.cpp

Anders Carlsson andersca at mac.com
Tue Dec 8 20:26:03 PST 2009


Author: andersca
Date: Tue Dec  8 22:26:02 2009
New Revision: 90948

URL: http://llvm.org/viewvc/llvm-project?rev=90948&view=rev
Log:
In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more than one heirarchy of classes. John, please review.

Modified:
    cfe/trunk/lib/AST/CXXInheritance.cpp
    cfe/trunk/test/SemaCXX/using-decl-1.cpp

Modified: cfe/trunk/lib/AST/CXXInheritance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CXXInheritance.cpp?rev=90948&r1=90947&r2=90948&view=diff

==============================================================================
--- cfe/trunk/lib/AST/CXXInheritance.cpp (original)
+++ cfe/trunk/lib/AST/CXXInheritance.cpp Tue Dec  8 22:26:02 2009
@@ -117,14 +117,16 @@
         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;

Modified: cfe/trunk/test/SemaCXX/using-decl-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/using-decl-1.cpp?rev=90948&r1=90947&r2=90948&view=diff

==============================================================================
--- cfe/trunk/test/SemaCXX/using-decl-1.cpp (original)
+++ cfe/trunk/test/SemaCXX/using-decl-1.cpp Tue Dec  8 22:26:02 2009
@@ -38,3 +38,7 @@
     (*this)(1);
   }
 };
+
+struct A { void f(); };
+struct B : A { };
+class C : B { using B::f; };





More information about the cfe-commits mailing list