where is the specialization?

Yotam Medini yotamm@tmai.com
Mon Oct 13 11:59:00 GMT 1997

In the following, both g++ and Sun's CC generate
template specialization code. With egcs's g++ I don't get any. 
Am I missing a new syntax?
-- yotam

   telaviv:1090> cat spec.cc
   template<class T>
   class C
      static const char* say();

   const char* C<int>::say()
   { return "I am int";  }

   const char* C<float>::say()
   { return "I am float";  }
   telaviv:1091> CC  -c spec.cc; nm spec.o | /usr/lang/sc/bin/c++filt
   00000048 T static C<float>::say(void)
   00000010 T static C<int>::say(void)
   telaviv:1092> g++ -c spec.cc; nm spec.o | c++filt
   00000000 t gcc2_compiled.
   0000002c T C<float>::say(void)
   00000000 T C<int>::say(void)
   telaviv:1093> egcs++ -c spec.cc; nm spec.o | c++filt
   00000004 C __eh_cleanup
   00000004 C __eh_in_catch
   00000004 C __eh_pc
   00000004 C __eh_type
   00000004 C __eh_value
   00000000 t gcc2_compiled.

More information about the Gcc-bugs mailing list