decl.c (grokdeclarator): Assert that we won't see a pointer to METHOD_TYPE.

* decl.c (grokdeclarator): Assert that we won't see a pointer to
	METHOD_TYPE.

From-SVN: r196748
This commit is contained in:
Jason Merrill 2013-03-16 23:11:07 -04:00 committed by Jason Merrill
parent bab5167fe6
commit d1f45df55b
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2013-03-16 Jason Merrill <jason@redhat.com>
* decl.c (grokdeclarator): Assert that we won't see a pointer to
METHOD_TYPE.
PR c++/54277
* cp-tree.h (WILDCARD_TYPE_P): Split out from...
(MAYBE_CLASS_TYPE_P): ...here.

View File

@ -9630,9 +9630,11 @@ grokdeclarator (const cp_declarator *declarator,
but to the target of the pointer. */
type_quals = TYPE_UNQUALIFIED;
/* This code used to handle METHOD_TYPE, but I don't think it's
possible to get it here anymore. */
gcc_assert (TREE_CODE (type) != METHOD_TYPE);
if (declarator->kind == cdk_ptrmem
&& (TREE_CODE (type) == FUNCTION_TYPE
|| (memfn_quals && TREE_CODE (type) == METHOD_TYPE)))
&& TREE_CODE (type) == FUNCTION_TYPE)
{
memfn_quals |= type_memfn_quals (type);
type = build_memfn_type (type,