diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-11-19 02:34:29 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-11-19 02:34:29 +0000 |
commit | 0657c69c3240a594ca3335ac3721be40a47c0ee8 (patch) | |
tree | 5274a0940bb4a0be8f35f3810bf141d21fcb1833 /gcc | |
parent | 7f0614d816a142cfd822e860753671afd32f41ae (diff) | |
download | gcc-0657c69c3240a594ca3335ac3721be40a47c0ee8.zip gcc-0657c69c3240a594ca3335ac3721be40a47c0ee8.tar.gz gcc-0657c69c3240a594ca3335ac3721be40a47c0ee8.tar.bz2 |
* decl.c (grokparms): Don't create parameters of `void' type.
From-SVN: r37553
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 54d4237..93b1689 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a357526..fe964ea 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); |