This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: .weak vs. C++ templates. was: SCO 5.0.2 error
>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:
Jason> I've come to the conclusion that the right fix for this
Jason> situation is to always make template instantiations weak,
Jason> whether implicit or explicit. Sound reasonable?
This sounds OK to me. If you've got implicit instantiations that are
different from an explicit instantiation, you've broken the rules
anyhow. (Not that this prevents someone from having depended on the
old behavior...)
You will lose the diagnostic at link-time that tells you that you've
got multiple explicit instantiations, unless we added some kind of
other linker support. I assume no diagnostic is required in this case
by the standard. In any event, it's certainly better to miss an
obscure diagnostic than to be broken for conforming code.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com