This is the mail archive of the gcc-bugs@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: Repo mechanism worse than in version 2.7.2


[ pardon the dup, I forgot to send to the list also... ]

> Date: Thu, 24 Feb 2000 17:03:47 +0000
> From: Duncan Stansfield <duncans@sco.COM>
 
> The problem is the repo mechanism does not instantiate as many
> symbols during the recompilation step.
 
This is a feature, not a bug.
 
> Is this a bug?
 
Nope.
 
> Is there any plan to alter this behaviour?
 
Nope, not really.  Exported templates I think will make this work when
implemented and your code fixed to use it, if you want.
 
> Is it possible to use the output from the linker to instantiate
> extra object code (The repo mechanism has the code, why can't it
> instantiate the function?)?
 
Welcome to C++.  Every use of a template must be able to see the
definition of everything it uses, the only exception is for exported
templates as I recall.  You fail to show the definition of
firstclass<int>::method(void) to secondclass.o.  This is wrong.  You
must show the defition to second.o, if you want to code in standard
C++.  As a undocumented g++ extension, you can also fix it by having
some file, any file have a use of firstclass<int>::method(void) and
have it be shown the definition for it, but this of course is
non-standard C++.

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