This is the mail archive of the gcc@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]

Re: C++ ABI: cloning of constructors/destructors


dspezia@amadeus.net wrote:
> 
> Hi all,
> 
> I've just installed GCC 3.0 on a i386 linux box.
> 
> Having a look at the code generated from a dummy C++
> program, it seems constructors and destructors are
> generated twice even for the simplest classes.
> 
> I'm just curious: what is the purpose of this cloning process ?
See http://gcc.gnu.org/bugs.html#known, from which I quote

G++ emits two copies of constructors and destructors. 

       In general there are three types of constructors (and destructors). 
           1.The complete object constructor/destructor. 
           2.The base object constructor/destructor. 
           3.The allocating destructor/deallocating destructor. 
       The first two are different, when virtual base classes are involved. In some cases we can do better, and this is logged in GNATS.


nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org


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