re PR c/27953 (ICE with invalid function definitions)
authorLee Millward <lee.millward@codesourcery.com>
Sat, 2 Dec 2006 16:34:26 +0000 (16:34 +0000)
committerLee Millward <lmillward@gcc.gnu.org>
Sat, 2 Dec 2006 16:34:26 +0000 (16:34 +0000)
PR c/27953
* c-decl.c (store_parm_decls_oldstyle): Robustify
        * gcc.dg/pr27953.c: New test.

From-SVN: r119446

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr27953.C [new file with mode: 0644]

index eef0bb0..e1ae8cb 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-02  Lee Millward  <lee.millward@codesourcery.com>
+
+       PR c/27953
+       * c-decl.c (store_parm_decls_oldstyle): Robustify.
+       
 2006-11-30  Jan Hubicka  <jh@suse.cz>
            Uros Bizjak  <ubizjak@gmail.com>
 
index fa1c340..bd737d1 100644 (file)
@@ -6482,8 +6482,8 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
       tree type;
       for (parm = DECL_ARGUMENTS (fndecl),
             type = current_function_prototype_arg_types;
-          parm || (type && (TYPE_MAIN_VARIANT (TREE_VALUE (type))
-                            != void_type_node));
+          parm || (type && TREE_VALUE (type) != error_mark_node
+                   && (TYPE_MAIN_VARIANT (TREE_VALUE (type)) != void_type_node));
           parm = TREE_CHAIN (parm), type = TREE_CHAIN (type))
        {
          if (parm == 0 || type == 0
index df43234..6159e46 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-02  Lee Millward  <lee.millward@codesourcery.com>
+
+       PR c/27953
+       * gcc.dg/pr27953.c: New test.
+
 2006-12-01  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/30022
diff --git a/gcc/testsuite/gcc.dg/pr27953.C b/gcc/testsuite/gcc.dg/pr27953.C
new file mode 100644 (file)
index 0000000..1424e54
--- /dev/null
@@ -0,0 +1,4 @@
+/* PR c/27953 */
+
+void foo(struct A a) {}  /* { dg-error "parameter list|definition|incomplete type" } */
+void foo() {}            /* { dg-error "redefinition" }
\ No newline at end of file