something wrong with template instantiation mechanics

Oleg Krivosheev kriol@fnal.gov
Thu Oct 9 16:31:00 GMT 1997


  Hi,

i've tried my code and lloks like tons of
small inline template functions are not
instantiated.

drabble ~ $ c++ -v
Reading specs from
/home/room1/kriol/local/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.90.12/specs
gcc version egcs-2.90.12 971008 (gcc2-970802 experimental)
drabble ~ $ uname -a
SunOS drabble 5.5.1 Generic_103640-08 sun4m sparc SUNW,SPARCstation-4

in a simple example:

#include "typedefs.H"
#include "Vector3D.H"

int
main( void ) {
  return 0;
}

void
superdummy( void ) {
  TVector3D<double> ccc;
  ccc = 1.0;
  abs(ccc);
}


where abs(ccc) declared as

template <class x> inline x
abs( const TVector3D<x>& y );

is not instantiated:

c++ -c test.ii        
nm -s test.o | c++filt | grep abs
         U abs(TVector3D<double> const &)

i'd expect it to be instantiated and marked W

i've enclosed full preprocessor output file.

thanks

OK


More information about the Gcc mailing list