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]
Other format: [Raw text]

Re: g++ generates code for constructors and destructors several times


On Wed, May 19, 2010 at 9:17 AM, LÃnaÃc Huard <lenaic.huard@laposte.net> wrote:
> If I remove the virtual keyword to make the class non-polymorphic, the
> constructor is still compiled twice, as well as the destructor.
>
> Would anyone have the patience to explain me why the constructors/destructors
> are compiled several times ?

See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3187.  Note 4.5 has
improved this situation for many targets so you might want to try that
version of GCC.

Thanks,
Andrew Pinski


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