15285 – [3.4/4.0 regression] instantiate_type ICE when forming pointer to template function (original) (raw)
Description Robert Evans 2004-05-04 19:52:02 UTC
The compiler throws an ICE when trying to form a pointer to an instance of a template function from within a different template function. This worked in gcc-3.3.3 and is also broken in the mainline.
tf.C*************
void foo(void (*func)()) {}
template void bar() {}
template void baz() { foo(&bar); }
$ g++ tf.C tf.C: In member function `void Class::foo(Object*)': tf.C🔞 internal compiler error: in instantiate_type, at cp/class.c:6164
$ g++ -v Reading specs from /home/bob/bin/gcc-3.4/lib/gcc/i686-pc-linux-gnu/3.4.0/specs Configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c++ --prefix=/home/bob/bin/gcc-3.4 Thread model: posix gcc version 3.4.0