Commit 547206a4 by Jason Merrill Committed by Jason Merrill

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: r171103
parent 8054a389
2011-03-17 Jason Merrill <jason@redhat.com>
PR c++/48166
* decl.c (revert_static_member_fn): Strip function-cv-quals.
2011-03-16 Jason Merrill <jason@redhat.com>
PR c++/48089
......
......@@ -13344,10 +13344,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));
......
2011-03-17 Jason Merrill <jason@redhat.com>
* g++.dg/parse/memfnquals1.C: New.
2011-03-17 Richard Guenther <rguenther@suse.de>
PR middle-end/48134
......
// PR c++/48166
struct foo {
static void func ();
};
void foo::func () const {} // { dg-error "type qualifiers" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment