The following invalid testcase triggers an ICE since GCC 4.4.1: ================== void foo(int i) { int a[i]; a = {}; } ================== bug.cc: In function 'void foo(int)': bug.cc:4:8: internal compiler error: tree check: expected integer_cst, have nop_expr in process_init_constructor_array, at cp/typeck2.c:912 Please submit a full bug report, [etc.]
Created attachment 19020 [details] gcc45-pr42059.patch Caused by PR40689. Here is an untested fix.
Subject: Bug 42059 Author: jakub Date: Tue Nov 17 06:59:13 2009 New Revision: 154237 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154237 Log: PR c++/42059 * typeck.c (cp_build_modify_expr): For initializer list call check_array_initializer to make sure lhs isn't a VLA. * g++.dg/cpp0x/initlist26.C: New test. Added: trunk/gcc/testsuite/g++.dg/cpp0x/initlist26.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 42059 Author: jakub Date: Tue Nov 17 07:21:43 2009 New Revision: 154239 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154239 Log: PR c++/42059 * typeck.c (cp_build_modify_expr): For initializer list call check_array_initializer to make sure lhs isn't a VLA. * g++.dg/cpp0x/initlist26.C: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist26.C Modified: branches/gcc-4_4-branch/gcc/cp/ChangeLog branches/gcc-4_4-branch/gcc/cp/typeck.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed.