When compiling with g++ 4.1.1 (shipping build on Fedora 5 i386), the following line cause runtime segmentation fault.
void AddElement (const T& val) { _array[Newidx()] = val; } A complete test case is attached below. The error also occurs on gcc 4.2.0 (built from snapshot, gcc version 4.2.0, Revision: 116178) Not occured on gcc 3.3.5 . -- Summary: [4.1.1 regression]runtime segfault with array assignment on i386-redhat-linux Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sourceinsight001 at gmail dot com GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28951