===================================================================
@@ -7998,6 +7998,11 @@ grokfndecl (tree ctype,
DECL_EXTERNAL (decl) = 1;
if (TREE_CODE (type) == FUNCTION_TYPE)
{
+ if (quals || rqual)
+ TREE_TYPE (decl) = apply_memfn_quals (TREE_TYPE (decl),
+ TYPE_UNQUALIFIED,
+ REF_QUAL_NONE);
+
if (quals)
{
error (ctype
===================================================================
@@ -0,0 +1,6 @@
+// PR c++/67845
+
+typedef void F () const;
+
+F foo; // { dg-error "cv-qualifier" }
+void foo ();