This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Content of VTT


I read about VTT's structure from here (http://refspecs.linuxbase.org/cxxabi-1.83.html#vtable-ctor) (2.6.2). However, I do not understand the purpose of all the elements present. 

The primary virtual pointer should point to the primary virtual table of D (in the vtable group, correct?) 

The secondary VTTs contain VTTs that are given to the direct non-virtual base classes (let's call them B) when they are constructed. My understanding is that because these direct base classes (B) may inherit from virtual classes, these direct base classes (B) should give these already initialized virtual classes some other vtable, to "make them believe" they are only part of each B. Is this correct? 

Now, what is the purpose of the last 2 types of entries: secondary virtual pointers and virtual VTTs? I understand that virtual classes in the inheritance hierarchy were not given a proper final vtable, so this could be one of the purpose. Also, virtual classes may inherit themselves from other virtual classes (consider that V1 inherits from V2). Then V2 needs again a special vtable to "make it believe" it is part of V1 (when V1 is being constructed). 

I would appreciate it if you could explain the exact content and purpose of each type of entry in the VTT.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]