summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-03-29 12:07:15 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-03-29 12:07:15 -0400
commitab630c593369ab1c13bea5072ea8d017768fc75d (patch)
tree6710cbd0162074f0074ffbe898d44835fb1e5eb7 /gcc/cp/decl.c
parent5a9970d5c5e44898654b3bf9b5d70db1c758d839 (diff)
downloadgcc-ab630c593369ab1c13bea5072ea8d017768fc75d.tar.gz
re PR c++/48166 (ICE on static member function with invalid type qualifier)
PR c++/48166 * decl.c (revert_static_member_fn): Strip function-cv-quals. From-SVN: r171679
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fbd6c9784fd..41beef35a00 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13342,10 +13342,14 @@ static_fn_type (tree memfntype)
void
revert_static_member_fn (tree decl)
{
- TREE_TYPE (decl) = static_fn_type (decl);
+ tree stype = static_fn_type (decl);
- if (cp_type_quals (TREE_TYPE (decl)) != TYPE_UNQUALIFIED)
- error ("static member function %q#D declared with type qualifiers", decl);
+ if (type_memfn_quals (stype) != TYPE_UNQUALIFIED)
+ {
+ error ("static member function %q#D declared with type qualifiers", decl);
+ stype = apply_memfn_quals (stype, TYPE_UNQUALIFIED);
+ }
+ TREE_TYPE (decl) = stype;
if (DECL_ARGUMENTS (decl))
DECL_ARGUMENTS (decl) = DECL_CHAIN (DECL_ARGUMENTS (decl));