This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: something wrong with template instantiation mechanics
- To: Joe Buck <jbuck at synopsys dot com>
- Subject: Re: something wrong with template instantiation mechanics
- From: Oleg Krivosheev <kriol at fnal dot gov>
- Date: Thu, 9 Oct 1997 22:17:58 -0500 (CDT)
- cc: Oleg Krivosheev <kriol at fnal dot gov>, egcs team <egcs at cygnus dot com>
Hi,
On Thu, 9 Oct 1997, Joe Buck wrote:
> > i've tried my code and lloks like tons of
> > small inline template functions are not
> > instantiated.
>
> I think that this is a consequence of the new rules: you have both
> non-template and template abs functions. Unfortunately, I'm confused
> by the new rules and not sure what is really supposed to change; I
> also think that there still may be some bugs in the code that implements
> them.
sorry, i sent a bit misleading example - maybe you're right,
i'm reading CD2 now.
Still i believe there are bugs in template instantiation -
if you change superdummy in the atached test.ii to
void
superdummy( void ) {
TVector3D<double> ccc, ddd;
ccc = 1.0;
abs(ccc);
ccc = ccc + ddd;
}
egcs will not be able instantiate
op+( const TVector3D<double>&, const TVector3D<double>& ) !
drabble ~ $ nm -s test.o | c++filt | grep Vec
00000000 W TVector3D<double>::~TVector3D(void)
00000000 W TVector3D<double>::operator=(TVector3D<double> const &)
00000000 W TVector3D<double>::operator=(double)
U operator+(TVector3D<double> const &, TVector3D<double> const &)
00000000 W TVector3D<double>::TVector3D(void)
U abs(TVector3D<double> const &)
there is no template/nontemplate op+ ix in the code.
Can you verify this one?
thanks
OK