clang: clang::CXXBasePaths Class Reference (original) (raw)

BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases. More...

BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases.

For example, given the following class hierarchy:

class A { };

class B : public A { };

class C : public A { };

class D : public B, public C{ };

There are two potential BasePaths to represent paths from D to a base subobject of type A. One path is (D,0) -> (B,0) -> (A,0) and another is (D,0)->(C,0)->(A,1). These two paths actually refer to two different base class subobjects of the same type, so the BasePaths object refers to an ambiguous path. On the other hand, consider the following class hierarchy:

class A { };

class B : public virtual A { };

class C : public virtual A { };

class D : public B, public C{ };

Here, there are two potential BasePaths again, (D, 0) -> (B, 0) -> (A,v) and (D, 0) -> (C, 0) -> (A, v), but since both of them refer to the same base class subobject of type A (the virtual one), there is no ambiguity.

Definition at line 116 of file CXXInheritance.h.