This is the mail archive of the
mailing list for the GCC project.
Re: [LTO] Question about comdat linkage of implicit ctor and dtor.
- From: Mark Mitchell <mark at codesourcery dot com>
- To: "Doug Kwan (éæå)" <dougkwan at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Rafael Espindola <espindola at google dot com>
- Date: Fri, 21 Nov 2008 16:21:37 -0800
- Subject: Re: [LTO] Question about comdat linkage of implicit ctor and dtor.
- References: <email@example.com>
Doug Kwan (éæå) wrote:
> did to called import_export_decl to determine the linkage. As far as
> I know it is an error to re-define an implicitly declared
> constructor/destructor. So gcc should be able to determine the
> linkage early, when such a constructor/destructor is declared
I don't think that's true. The linkage of the constructor or destructor
cannot be determined until the linkage of the class as a whole is
determined, and we might not know that until later in the file.
However, it certainly can be determined at the end of the translation
unit. And, if we're generating implicit constructors in implicitly
instantiated template classes, without marking them as having vague
linkage, that certainly sounds like a bug. However, I'd think it would
also show up without LTO when not optimizing, as that would result in
multiple definitions at link-time.
(650) 331-3385 x713