g++ asked me to submit a report: g++: Internal error: Segmentation fault (program cc1plus) Please submit a full bug report. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
I was able to trim the code down to: // bug_20060724.cc // =============== template < typename T > class pointer; template < typename T > struct pointer_ref { pointer_ref ( pointer< T > r ) throw () {} }; // pointer_ref<> template < typename T > struct pointer { pointer ( pointer & other ) throw() {} pointer ( pointer_ref< T > ref ) throw() {} }; // pointer<> pointer<int> create ( void ) {} int main ( void ) { pointer<int> bb ( create() ); } // end of file Specs are: /added/pkg/gcc-4.1.0/usr/bin/g++ -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.1.0/configure --prefix=/added/pkg/gcc-4.1.0/usr --with-ld=/usr/i686-pc-linux-gnu/binutils-bin/2.16.1/ld --with-as=/usr/i686-pc-linux-gnu/binutils-bin/2.16.1/as --host=i686-pc-linux-gnu Thread model: posix gcc version 4.1.0 Best Kai-Uwe Bux -- Summary: Internal error: Segmentation fault (program cc1plus) Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jkherciueh at gmx dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28475