The following testcase: template<class T> class __attribute__((visibility("default"))) Foo { Foo<T> bar(); }; template<class T> Foo<T> Foo<T>::bar() { } Produces: foo.cpp: In member function ‘Foo<T> Foo<T>::bar()’: foo.cpp:6: internal compiler error: Segmentation fault
This works for me with "4.2.0 20060823" and "4.1.2 20060814" on "i686-pc-linux-gnu".
Looks recently fixed by patch for PR 28659.
You must have something backported to 4.1.x because the patch which orginally caused this was only on the mainline. *** This bug has been marked as a duplicate of 28659 ***