ICE in template instanciation

Jose Gomes Jose.Gomes@sophia.inria.fr
Wed Feb 24 23:52:00 GMT 1999


Hi,


A pointer to a known method can be a template
argument (it works fine with egcs).
However, using 0 as a pointer to method
in this context gives an I.C.E, as you can see
in the following:



#bin/g++ -v
Reading specs from
/u/corse/2/robotvis/gnu/bin/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.93.02/specs
gcc version egcs-2.93.02 19990118 (gcc2 ss-980609 experimental)
#ls
null_pointer_to_method_as_template_argument.C
#cat null_pointer_to_method_as_template_argument.C 

class A {};
typedef void (A::*method)();

template <class A, void (A::*m)() >
void f() {}

int main() {

  f< A, (method) 0>();

  return 0;
}

#g++ g++ null_pointer_to_method_as_template_argument.C
null_pointer_to_method_as_template_argument.C: g++: Internal compiler
error: program cc1plus got fatal signal 11
#ls
core
null_pointer_to_method_as_template_argument.C
#



Does someone know if this code is permited or if it is really
a bug ?

Best regards,

Jose.





-- 
 Jose.Gomes@sophia.inria.fr             Tel. +33 4 92 38 76 48	
 http://www.inria.fr/robotvis/personnel/jgomes
 Projet RobotVis, INRIA, 2004, route des Lucioles - B.P. 93	
 F-06902 Sophia Antipolis Cedex, FRANCE


More information about the Gcc-bugs mailing list