aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorDouglas Gregor <doug.gregor@gmail.com>2007-03-28 12:31:37 +0000
committerDoug Gregor <dgregor@gcc.gnu.org>2007-03-28 12:31:37 +0000
commit771026dd0ccaad37e4af85be52f6bc15a47da194 (patch)
treeef14ed66fcc9bf60ceb65618d216f1c72fa7413e /gcc/cp/decl.c
parent27a0ce7d429e72c249e8cadd47bbfba127ea1b98 (diff)
downloadgcc-771026dd0ccaad37e4af85be52f6bc15a47da194.zip
gcc-771026dd0ccaad37e4af85be52f6bc15a47da194.tar.gz
gcc-771026dd0ccaad37e4af85be52f6bc15a47da194.tar.bz2
[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
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index eefbba3..f107bee 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;