g++ reports: "gpp_bug.cpp:10: internal compiler error: Segmentation fault", on both Gentoo Linux (gcc 3.3.5) and Solaris (gcc 3.3.2). Full output of "g++ gpp_bug.cpp": gpp_bug.cpp: In function `void func()': gpp_bug.cpp:10: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccIkMcGH.out file, please attach this to your bugreport. Output of "g++ -v" on the Linux system: Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs Configured with: /var/tmp/portage/gcc-3.3.5-r1/work/gcc-3.3.5/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.5 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3 --host=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --enable-shared --enable-threads=posix --disable-multilib --enable-java-awt=gtk --enable-languages=c,c++,f77,java Thread model: posix gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) Offending source code: //BEGIN SOURCE CODE: template <class T> struct bar { typedef T INNER_TYPE_DEF; }; template<class T> void func(){ typedef typename bar<T>::INNER_TYPE_DEF LOCAL_TYPE_DEF; LOCAL_TYPE_DEF<T> b; } int main(){ } //END SOURCE CODE Obviously "LOCAL_TYPE_DEF<T>" is nonsensical, I stumbled on this segfault as a result of a typo.
-- Summary: Segmentation fault on template/typedef typo Product: gcc Version: 3.3.5 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sjanssen at cse dot unl dot edu CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21040