Whatever the gcc should do, I don't think it should crash in the following case (I shall try to re-build the latest 4.4.2 series to reproduce it there as well, if I'll find the time):
Start of code: template <typename N, N M> struct boo { }; template <typename N, N P, template <typename X, X M> class Base> struct goo : Base<N, P> { }; int main() { goo<int, 1, boo> goo1; return 0; } Start of command-line which causes the crash: gcc main.cc Start of gcc-output as it crashes: main.cc: In function 'int main()': main.cc:13: internal compiler error: in dependent_type_p, at cc1plus/../../../../contrib/gcc/cp/pt.c:12777 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. Start of gcc --version output: %gcc --version gcc (GCC) 4.2.1 20070719 [FreeBSD] Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Start of uname -a output: %uname -a FreeBSD localhost 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 07:18:07 UTC 2009 r...@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 -- Summary: gcc crash (internal compiler error) during the build of C++ code Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: leonleon77 at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42446