http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46813
Summary: crashes on template definition error Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: j...@nii.net I am trying to make a generic function which can be a STATIC member of several different unrelated classes. When I use the following line in the template definition, the compiler crashes. It is very repeatable. template <class T> T* T::list_builder (void) I know there's an error here (I haven't figured it out yet), but the compiler should be able to handle it without crashing. The output of the <gcc -v -save-temps segment2.cpp> command is: [j...@tyan bug]$ [j...@tyan bug]$ gcc -v -save-temps segment2.cpp Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) /usr/libexec/gcc/i386-redhat-linux/4.1.2/cc1plus -E -quiet -v -D_GNU_SOURCE segment2.cpp -mtune=generic -fpch-preprocess -o segment2.ii ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2 /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward /usr/local/include /usr/lib/gcc/i386-redhat-linux/4.1.2/include /usr/include End of search list. /usr/libexec/gcc/i386-redhat-linux/4.1.2/cc1plus -fpreprocessed segment2.ii -quiet -dumpbase segment2.cpp -mtune=generic -auxbase segment2 -version -o segment2.s GNU C++ version 4.1.2 20070925 (Red Hat 4.1.2-33) (i386-redhat-linux) compiled by GNU C version 4.1.2 20070925 (Red Hat 4.1.2-33). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64367 Compiler executable checksum: 22880ea8f8f6afdf4de1aaa96156a5d5 segment2.cpp:7: internal compiler error: in is_ancestor, at cp/name-lookup.c:2243 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla> for instructions. Preprocessed source stored into /tmp/ccWYwZGS.out file, please attach this to your bugreport. [j...@tyan bug]$