===================================================================
@@ -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 "
===================================================================
@@ -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);
};
===================================================================
@@ -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);