diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-06-23 17:05:33 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-06-23 17:05:33 +0000 |
commit | e7402b3acc232144a730c5618d46b643eeae0f3e (patch) | |
tree | 0513e90d9b31066868ab1ed0f3705c0227a06c40 /gcc/cp | |
parent | 7b56b2f848d36fc3c5445f74c38720bd93e5f9e2 (diff) | |
download | gcc-e7402b3acc232144a730c5618d46b643eeae0f3e.zip gcc-e7402b3acc232144a730c5618d46b643eeae0f3e.tar.gz gcc-e7402b3acc232144a730c5618d46b643eeae0f3e.tar.bz2 |
DR 577 PR c++/33101
/cp
2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
DR 577
PR c++/33101
* decl.c (grokparms): Accept a single parameter of type 'void'.
/testsuite
2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
DR 577
PR c++/33101
* g++.dg/other/void1.C: Adjust.
* g++.dg/other/void3.C: Likewise.
From-SVN: r211906
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a8bc633..1540c97 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-06-23 Paolo Carlini <paolo.carlini@oracle.com> + + DR 577 + PR c++/33101 + * decl.c (grokparms): Accept a single parameter of type 'void'. + 2014-06-20 Jason Merrill <jason@redhat.com> PR c++/59296 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a76980f..b4d8b94 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11138,16 +11138,13 @@ grokparms (tree parmlist, tree *parms) type = TREE_TYPE (decl); if (VOID_TYPE_P (type)) { - if (type == void_type_node + if (same_type_p (type, void_type_node) && !init && !DECL_NAME (decl) && !result && TREE_CHAIN (parm) == void_list_node) - /* this is a parmlist of `(void)', which is ok. */ + /* DR 577: A parameter list consisting of a single + unnamed parameter of non-dependent type 'void'. */ break; - else if (typedef_variant_p (type)) - error_at (DECL_SOURCE_LOCATION (decl), - "invalid use of typedef-name %qT in " - "parameter declaration", type); else if (cv_qualified_p (type)) error_at (DECL_SOURCE_LOCATION (decl), "invalid use of cv-qualified type %qT in " |