Commit 0657c69c by Mark Mitchell Committed by Mark Mitchell

* decl.c (grokparms): Don't create parameters of `void' type.

From-SVN: r37553
parent 7f0614d8
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> 2000-11-17 Zack Weinberg <zack@wolery.stanford.edu>
* lex.c (mark_impl_file_chain): Delete. * lex.c (mark_impl_file_chain): Delete.
......
...@@ -11989,7 +11989,7 @@ grokparms (first_parm) ...@@ -11989,7 +11989,7 @@ grokparms (first_parm)
for (parm = first_parm; parm != NULL_TREE; parm = chain) 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); register tree decl = TREE_VALUE (parm);
tree init = TREE_PURPOSE (parm); tree init = TREE_PURPOSE (parm);
...@@ -12022,6 +12022,10 @@ grokparms (first_parm) ...@@ -12022,6 +12022,10 @@ grokparms (first_parm)
/* this is a parmlist of `(void)', which is ok. */ /* this is a parmlist of `(void)', which is ok. */
break; break;
incomplete_type_error (decl, type); 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 /* Top-level qualifiers on the parameters are
...@@ -12069,9 +12073,7 @@ grokparms (first_parm) ...@@ -12069,9 +12073,7 @@ grokparms (first_parm)
TREE_CHAIN (decl) = decls; TREE_CHAIN (decl) = decls;
decls = decl; decls = decl;
list_node = tree_cons (init, type, NULL_TREE); result = tree_cons (init, type, result);
TREE_CHAIN (list_node) = result;
result = list_node;
} }
decls = nreverse (decls); decls = nreverse (decls);
result = nreverse (result); result = nreverse (result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment