[cfe-dev] CXXRecordDecl: bases() vs vbases()

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 10 10:49:11 PST 2021


I'd guess 'bases()' probably gives direct base classes and vbases()
probably gives direct virtual base classes, eg:

struct x : y, virtual z { };

probably 'bases()' contains 'y' and 'vbases()' contains 'z' - but test
it and find out?

On Wed, Feb 10, 2021 at 4:51 AM Deep Majumder via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> Hello everyone,
> While trying to iterate over the base classes of a class/struct represented by a CXXRecordDecl, I found two methods: one is bases() and the other is bases().
> Is it that bases() returns all instantiable base classes, while vbases() returns all abstract base classes? Or is it something different?
> Warm regards,
> Deep
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list