aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2005-11-25 14:59:09 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2005-11-25 14:59:09 +0000
commite7e531924324c744fd5bce4aef999ad99fbc8f61 (patch)
treedce122d4f6cef385b2cf791a769d7cf82e664eff /gcc/cp
parentdd6f2a43780177ecf4f55585ec19c49abfffbe5e (diff)
downloadgcc-e7e531924324c744fd5bce4aef999ad99fbc8f61.zip
gcc-e7e531924324c744fd5bce4aef999ad99fbc8f61.tar.gz
gcc-e7e531924324c744fd5bce4aef999ad99fbc8f61.tar.bz2
re PR c++/9278 (Illegal use of typedef to "void")
PR c++/9278 * decl.c (grokparms): Do not allow typedef-names in a '(void)' parmlist. * g++.dg/other/void1.C: New test. From-SVN: r107508
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d97fe45..5e5df9b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+ PR c++/9278
+ * decl.c (grokparms): Do not allow typedef-names in a '(void)'
+ parmlist.
+
+2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
* typeck2.c (process_init_constructor_union): Remove check for
unnamed union members.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d87983c..dec134a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8598,6 +8598,7 @@ grokparms (cp_parameter_declarator *first_parm, tree *parms)
if (VOID_TYPE_P (type))
{
if (same_type_p (type, void_type_node)
+ && DECL_SELF_REFERENCE_P (type)
&& !DECL_NAME (decl) && !result && !parm->next && !ellipsis)
/* this is a parmlist of `(void)', which is ok. */
break;