This is the mail archive of the gcc-patches@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: [LTO] Question about comdat linkage of implicit ctor and dtor.


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
> implictly. 

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.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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