+2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
+
+ PR c++/29993
+ * decl.c (grokdeclarator): Deal with cv-qualified function type
+ typedefs in the same way for member and non-member functions.
+
2007-03-26 Dirk Mueller <dmueller@suse.de>
* parser.c (cp_parser_member_declaration): Pedwarn
member function of S. We record the cv-qualification in the
function type. */
if (memfn_quals && TREE_CODE (type) == FUNCTION_TYPE)
- type = cp_build_qualified_type (type, memfn_quals);
+ {
+ type = cp_build_qualified_type (type, memfn_quals);
+
+ /* We have now dealt with these qualifiers. */
+ memfn_quals = TYPE_UNQUALIFIED;
+ }
if (decl_context == FIELD)
decl = build_lang_decl (TYPE_DECL, unqualified_id, type);
type with external linkage have external linkage. */
}
- /* Any qualifiers on a function type typedef have already been
- dealt with. */
- if (memfn_quals && !ctype && TREE_CODE (type) == FUNCTION_TYPE)
- memfn_quals = TYPE_UNQUALIFIED;
-
if (signed_p
|| (typedef_decl && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl)))
C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1;
+2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
+
+
+ PR c++/29993
+ * g++.dg/other/cv_func2.C: New.
+
2007-03-27 Janis Johnson <janis187@us.ibm.com>
* gcc.dg/dfp/func-vararg-alternate.h: New file.
--- /dev/null
+typedef int ptr1() const; // no error
+
+void foo ()
+{
+ typedef int ptr2() const; // no error
+}
+
+class C
+{
+ typedef int ptr3() const; // error
+
+ void bar ()
+ {
+ typedef int ptr4() const; // no error
+ }
+};
+
+void wibble () const { } // { dg-error "non-member function" }