something wrong with template instantiation mechanics
Oleg Krivosheev
kriol@fnal.gov
Fri Oct 10 08:51:00 GMT 1997
On Thu, 9 Oct 1997, Oleg Krivosheev wrote:
> Date: Thu, 09 Oct 1997 22:17:58 -0500 (CDT)
>
> 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.
after reading CD2 and thinking a bit i still
believe this is a bug:
14.8.3 Overload resolution [temp.over]
..
For each function template, if the argument
deduction succeeds, the deduced template-arguments are used to instan-
tiate a single function template specialization which is added to the
candidate functions set to be used in overload resolution.
..
well, lloks like egcs deduces templates argument right,
then it properly did everload resolution and
choose template version of abs and generated
call - but no function body itself is instantiated !
regards
OK
More information about the Gcc
mailing list