[multiple changes]

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-28  Douglas Gregor  <doug.gregor@gmail.com>


	PR c++/29993
	* g++.dg/other/cv_func2.C: New.

From-SVN: r123294
This commit is contained in:
Douglas Gregor 2007-03-28 12:31:37 +00:00 committed by Doug Gregor
parent 27a0ce7d42
commit 771026dd0c
4 changed files with 36 additions and 6 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -8029,7 +8029,12 @@ grokdeclarator (const cp_declarator *declarator,
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);
@ -8091,11 +8096,6 @@ grokdeclarator (const cp_declarator *declarator,
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;

View File

@ -1,3 +1,9 @@
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.

View File

@ -0,0 +1,18 @@
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" }