$ cat >test.cc template <typename R> R make_smth(void); template <typename T> typeof(make_smth<T>()) f(T t) { return t; } void g(void) { int i; f(i); } $ g++ test.cc test.cc: In function `void g()': test.cc:3: Internal compiler error in write_type, at cp/mangle.c:1473 ...
test.cc: In function `void g()': test.cc:3: internal compiler error: in write_type, at cp/mangle.c:1555
still in gcc3.4: test.cc: In function `void g()': test.cc:3: internal compiler error: in write_type, at cp/mangle.c:1579
Same with g++ 4.1.1: test.cc: In function '__typeof__ (make_smth<T>()) f(T) [with T = int]': test.cc:2: internal compiler error: in write_type, at cp/mangle.c:1651 - maybe I should report it upstream? :)
$ g++-4.3 test.cc test.cc: In function '__typeof__ (make_smth<T>()) f(T) [with T = int]': test.cc:2: sorry, unimplemented: mangling typeof, use decltype instead