===================================================================
@@ -9007,7 +9007,7 @@ grokdeclarator (const cp_declarator *declarator,
return error_mark_node;
}
- if (((dname && IDENTIFIER_OPNAME_P (dname)) || flags == TYPENAME_FLAG)
+ if (flags == TYPENAME_FLAG
&& innermost_code != cdk_function
&& ! (ctype && !declspecs->any_specifiers_p))
{
===================================================================
@@ -0,0 +1,7 @@
+// PR c++/33972
+
+struct s
+{
+ typedef void f(void);
+ f operator();
+};
===================================================================
@@ -2,5 +2,5 @@
struct A
{
- template<operator+> void foo() {} // { dg-error "identifier|non-function|template arguments" }
+ template<operator+> void foo() {} // { dg-error "identifier|parameter|template arguments" }
};
===================================================================
@@ -1,6 +1,6 @@
//PR c++/27670
-template<operator+> void foo(); // { dg-error "before|non-function|template" }
+template<operator+> void foo(); // { dg-error "before|parameter|template" }
void bar()
{