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 | |
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
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/void1.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/void3.C | 2 |
5 files changed, 20 insertions, 10 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 " diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b6d09b3..e8eab59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +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. + 2014-06-23 Marek Polacek <polacek@redhat.com> PR c/61553 diff --git a/gcc/testsuite/g++.dg/other/void1.C b/gcc/testsuite/g++.dg/other/void1.C index 691e6f7..3f6b1db 100644 --- a/gcc/testsuite/g++.dg/other/void1.C +++ b/gcc/testsuite/g++.dg/other/void1.C @@ -4,13 +4,13 @@ typedef void VOID; int foo(void); -int bar(VOID); // { dg-error "type|invalid use" } +int bar(VOID); template<int> int foo(void); -template<int> int bar(VOID); // { dg-error "type|invalid use" } +template<int> int bar(VOID); struct A { int foo(void); - int bar(VOID); // { dg-error "type|invalid use" } + int bar(VOID); }; diff --git a/gcc/testsuite/g++.dg/other/void3.C b/gcc/testsuite/g++.dg/other/void3.C index 3494d2a..48a6609 100644 --- a/gcc/testsuite/g++.dg/other/void3.C +++ b/gcc/testsuite/g++.dg/other/void3.C @@ -1,4 +1,4 @@ // PR c++/33101 typedef void v; -typedef v (*pf)(v); // { dg-error "invalid use of typedef-name" } +typedef v (*pf)(v); |