The following invalid code snippet triggers an ICE on the trunk: ================= union U { int i, j; }; U u({1,2}); ================= bug.cc:6: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1101 Please submit a full bug report, [etc.]
And again...
Subject: Bug 38698 Author: jason Date: Sat Jan 3 00:19:55 2009 New Revision: 143024 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143024 Log: PR c++/38698 * typeck2.c (process_init_constructor_union): Handle excess initializers. (process_init_constructor_record): Likewise. PR c++/38684 * typeck2.c (digest_init_r): Don't use process_init_constructor for non-aggregate classes. Added: trunk/gcc/testsuite/g++.dg/cpp0x/initlist11.C trunk/gcc/testsuite/g++.dg/cpp0x/initlist12.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/typeck2.c trunk/gcc/testsuite/ChangeLog
Fixed.
Jason, the fix is unfortunately incomplete, because the following testcase still crashes: ================= union U {}; U u({ 1 }); ================= bug.cc:3: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1150 Please submit a full bug report, [etc.]
Subject: Bug 38698 Author: jason Date: Tue Jan 6 03:27:39 2009 New Revision: 143111 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143111 Log: PR c++/38698 * typeck2.c (process_init_constructor_union): Handle union with no fields. * mangle.c (write_expression): Remove mangling for zero-operand casts. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/mangle.c trunk/gcc/cp/typeck2.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/cpp0x/initlist12.C