The following invalid code snippet triggers an ICE since GCC 4.1.0: ================================ struct A {}; void foo() { (struct A){}(); } ================================ The compiler crashes trying to emit an error message, which results in a completely broken diagnostic (e.g. file name and "internal compiler error" message are missing): '{ In function 'foo': tree check: expected class 'expression', have 'exceptional' (constructor) in pp_c_initializer_list, at c-pretty-print.c:1182 Please submit a full bug report, [etc.] Before GCC 4.1.0 we got the error message: bug.c: In function 'foo': bug.c:5: error: called object '{}' is not a function
Patch at http://gcc.gnu.org/ml/gcc-patches/2008-03/msg01158.html
Subject: Bug 35440 Author: jakub Date: Fri Apr 4 13:07:27 2008 New Revision: 133897 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133897 Log: PR c/35440 * c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR for all types. * gcc.dg/pr35440.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr35440.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-pretty-print.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 35440 Author: jakub Date: Fri Apr 4 13:12:58 2008 New Revision: 133899 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133899 Log: PR c/35440 * c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR for all types. * gcc.dg/pr35440.c: New test. Added: branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/pr35440.c Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/c-pretty-print.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed.