* decl.c (grokparms): Don't create parameters of `void' type.
authorMark Mitchell <mark@codesourcery.com>
Sun, 19 Nov 2000 02:34:29 +0000 (02:34 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 19 Nov 2000 02:34:29 +0000 (02:34 +0000)
From-SVN: r37553

gcc/cp/ChangeLog
gcc/cp/decl.c

index 54d4237cb78371399b0df189beba9b60f7686fc7..93b1689b4238dce54778d28450f3b8c2b38ff8f3 100644 (file)
@@ -1,3 +1,7 @@
+2000-11-18  Mark Mitchell  <mark@codesourcery.com>
+
+       * decl.c (grokparms): Don't create parameters of `void' type.
+
 2000-11-17  Zack Weinberg  <zack@wolery.stanford.edu>
 
        * lex.c (mark_impl_file_chain): Delete.
index a357526aa0c1253e60441ddfdc3864fd442abc2d..fe964ea40fcb57010b8195efe2f4c412e2c7102e 100644 (file)
@@ -11989,7 +11989,7 @@ grokparms (first_parm)
 
   for (parm = first_parm; parm != NULL_TREE; parm = chain)
     {
-      tree type = NULL_TREE, list_node = parm;
+      tree type = NULL_TREE;
       register tree decl = TREE_VALUE (parm);
       tree init = TREE_PURPOSE (parm);
 
@@ -12022,6 +12022,10 @@ grokparms (first_parm)
             /* this is a parmlist of `(void)', which is ok.  */
             break;
           incomplete_type_error (decl, type);
+         /* It's not a good idea to actually create parameters of
+            type `void'; other parts of the compiler assume that a
+            void type terminates the parameter list.  */
+         TREE_TYPE (decl) = error_mark_node;
         }
       
       /* Top-level qualifiers on the parameters are
@@ -12069,9 +12073,7 @@ grokparms (first_parm)
 
       TREE_CHAIN (decl) = decls;
       decls = decl;
-      list_node = tree_cons (init, type, NULL_TREE);
-      TREE_CHAIN (list_node) = result;
-      result = list_node;
+      result = tree_cons (init, type, result);
     }
   decls = nreverse (decls);
   result = nreverse (result);