The following valid code snippet triggers an ICE since GCC 3.4.0: ============================== template<int> struct A { int i; A() { void foo(int=i); } };
A<0> a; ============================== bug.cc: In function 'void foo(int) [with int <anonymous> = 0]': bug.cc:4: instantiated from 'A<<anonymous> >::A() [with int <anonymous> = 0]' bug.cc:7: instantiated from here bug.cc:4: internal compiler error: Segmentation fault Please submit a full bug report, [etc.] GCC 3.3.x wrongly rejected the code ('i' as default parameter is not OK, but this should only be diagnosed if the default parameter is actually used). GCC 3.[012].x correctly accepted the code. Btw, the code compiles fine if A is not a template class. -- Summary: [4.2/4.3/4.4 regression] ICE with questionable default parameter of a member function Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, monitored Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39055