re PR c/28136 (ICE with incomplete array type)
authorVolker Reichelt <reichelt@gcc.gnu.org>
Sat, 5 Aug 2006 23:08:54 +0000 (23:08 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Sat, 5 Aug 2006 23:08:54 +0000 (23:08 +0000)
PR c/28136
* c-parser.c (c_parser_postfix_expression_after_paren_type): Robustify.

* gcc.dg/init-bad-5.c: New test.

From-SVN: r115952

gcc/ChangeLog
gcc/c-parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/init-bad-5.c [new file with mode: 0644]

index eb198c84acec4aa53381671df38976f37b7e479f..72e1d462d56a46189ad1f900806b33b20e3a716e 100644 (file)
@@ -1,8 +1,14 @@
+2006-08-05  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c/28136
+       * c-parser.c (c_parser_postfix_expression_after_paren_type): Robustify.
+
 2006-08-04  Jan Hubicka  <jh@suse.cz>
 
        PR target/26655
        PR target/28270
-       * reload.c (push_reload): Patch out the mismathcing instruction; return early.
+       * reload.c (push_reload): Patch out the mismatching instruction;
+       return early.
        (find_reload): Bail out if the instruction was patched out.
 
 2006-08-04  Jan Hubicka  <jh@suse.cz>
index 32d2c5108bfa0b5636f80b28c9710c953443d8a9..f895d423b31df1e101b3ef9706817b1af4b85cb3 100644 (file)
@@ -5432,7 +5432,7 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
   struct c_expr expr;
   start_init (NULL_TREE, NULL, 0);
   type = groktypename (type_name);
-  if (C_TYPE_VARIABLE_SIZE (type))
+  if (type != error_mark_node && C_TYPE_VARIABLE_SIZE (type))
     {
       error ("compound literal has variable size");
       type = error_mark_node;
index 9f0818209b0bec0f7d35af9cacd02a38a13f5396..99bbfc50309f9d6fde6e022e634c0df2db213d9f 100644 (file)
@@ -1,10 +1,14 @@
+2006-08-05  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c/28136
+       * gcc.dg/init-bad-5.c: New test.
+
 2006-08-03  Lee Millward  <lee.millward@codesourcery.com>
 
-       PR c++/28347
-       * g++.dg/ext/typedef-init.C: Add new test for typedef 
-       initialization inside templates. Adjust existing
-       error markers.
-       
+       PR c++/28347
+       * g++.dg/ext/typedef-init.C: Add new test for typedef 
+       initialization inside templates. Adjust existing error markers.
+
 2006-08-03  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/28148
diff --git a/gcc/testsuite/gcc.dg/init-bad-5.c b/gcc/testsuite/gcc.dg/init-bad-5.c
new file mode 100644 (file)
index 0000000..18cee43
--- /dev/null
@@ -0,0 +1,5 @@
+/* PR c/28136 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int i = (struct A[]) {};  /* { dg-error "incomplete|empty|initialization" } */