]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
DR 577 PR c++/33101
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 23 Jun 2014 17:05:33 +0000 (17:05 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 23 Jun 2014 17:05:33 +0000 (17:05 +0000)
/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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/void1.C
gcc/testsuite/g++.dg/other/void3.C

index a8bc6336628e85c19a046de72f7508459e21fcd1..1540c9742cdf94a0a541069e416180a7262dfed0 100644 (file)
@@ -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
index a76980f928a96079c6265ebce659195058ed1581..b4d8b94feb1c918687805027e01d98020110d37f 100644 (file)
@@ -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 "
index b6d09b366e4e91077b5af54b07d9e72ff7825e0f..e8eab59ea82d6bca1ba07f4571fd6393cde7f07c 100644 (file)
@@ -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
index 691e6f7824e9c5a6f7687f27f936a2b9f82c89db..3f6b1dbfe8ed8bf7a11cb8c7db4c7815f9c77dd3 100644 (file)
@@ -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);
 };
index 3494d2aefdb392163f936cdf8d9f6094f3eba77c..48a6609915d99aab7419c7e7a42942294869f1ce 100644 (file)
@@ -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);