+2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58810
+ * decl.c (grokdeclarator): Don't handle qualified free functions here,
+ leave the diagnostic to grokfndecl.
+
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59080
if (decl_context != TYPENAME)
{
- /* A cv-qualifier-seq shall only be part of the function type
- for a non-static member function. A ref-qualifier shall only
- .... /same as above/ [dcl.fct] */
- if ((type_memfn_quals (type) != TYPE_UNQUALIFIED
- || type_memfn_rqual (type) != REF_QUAL_NONE)
- && (current_class_type == NULL_TREE || staticp) )
- {
- error (staticp
- ? G_("qualified function types cannot be used to "
- "declare static member functions")
- : G_("qualified function types cannot be used to "
- "declare free functions"));
- type = TYPE_MAIN_VARIANT (type);
- }
-
/* The qualifiers on the function type become the qualifiers on
the non-static member function. */
memfn_quals |= type_memfn_quals (type);
+2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58810
+ * g++.dg/other/cv_func3.C: New.
+ * g++.dg/other/cv_func.C: Adjust.
+ * g++.dg/parse/fn-typedef2.C: Likewise.
+
2013-11-25 Marek Polacek <polacek@redhat.com>
PR sanitizer/59250
PR c++/59112
PR c++/59113
- g++.dg/cpp1y/pr58533.C: Updated testcase.
- g++.dg/cpp1y/pr59112.C: New testcase.
- g++.dg/cpp1y/pr59113.C: New testcase.
+ * g++.dg/cpp1y/pr58533.C: Updated testcase.
+ * g++.dg/cpp1y/pr59112.C: New testcase.
+ * g++.dg/cpp1y/pr59113.C: New testcase.
2013-11-25 Terry Guo <terry.guo@arm.com>
typedef int FIC(int) const;
typedef int FI(int);
-FIC f; // { dg-error "qualified" }
+FIC f; // { dg-error "cv-qualifier" }
struct S {
FIC f; // OK
--- /dev/null
+// PR c++/58810
+
+typedef int F() const;
+
+F f; // { dg-error "cv-qualifier" }
+
+struct A
+{
+ friend F f; // { dg-error "cv-qualifier" }
+};
typedef void V;
typedef V ft() const;
-ft f; // { dg-error "qualified" }
+ft f; // { dg-error "cv-qualifier" }