The following invalid code snippet triggers an ICE since GCC 4.3.0:
====================================================
template<int> void foo()
{
int i = ({ });
}
====================================================
bug.cc: In function 'void foo()':
bug.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Without the template we get a suitable error message:
bug.cc: In function 'void foo()':
bug.cc:3: error: void value not ignored as it ought to be
The code was wrongly accepted before GCC 4.3.0.
--
Summary: [4.3/4.4 regression] ICE with statement expression in
template
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-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=36408