From: Mark Mitchell Date: Sun, 19 Nov 2000 02:34:29 +0000 (+0000) Subject: * decl.c (grokparms): Don't create parameters of `void' type. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0657c69c3240a594ca3335ac3721be40a47c0ee8;p=gcc.git * decl.c (grokparms): Don't create parameters of `void' type. From-SVN: r37553 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 54d4237cb78..93b1689b423 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2000-11-18 Mark Mitchell + + * decl.c (grokparms): Don't create parameters of `void' type. + 2000-11-17 Zack Weinberg * lex.c (mark_impl_file_chain): Delete. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a357526aa0c..fe964ea40fc 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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);