Matching Indirect base classes

Hi,

Thanks Daniel, I suppose you mean CXXRecordDecl::lookupInBases() instead CXXRecordDecl::findInBases().

Have you ever used one of these methods? I don’t understand quite well how can I use them for my purpose. What I need is that, given an object CXXRecordDecl, I can analyze something in particular in each one of its base classes (direct or indirect). Thus, I need to get each one of these classes to process them, but the methods you refer only return a bool.

Could you please show me an example using these methods? Mainly, with respect the arguments passed to these methdos.

Thanks,

Pedro.

El día 08 nov 2013 15:32, Daniel Jasper djasper@google.com escribió:

Yes, sorry, lookupInBases() is what I meant. You’ll need forAllBases(). You can pass in a ForallBasesCallback, which is basically a callback function executed for each base class.

I have not used this myself, but for an example, look at:
CXXRecordDecl::isProvablyNotDerivedFrom defined in lib/AST/CXXInheritance.cpp.

Also lib/Sema/SemaDeclCXX.cpp has an example close to the bottom of Sema::CheckUsingDeclQualifier()
that collects all of the bases into a SmallPtrSet.