From d1f45df55be8f73a75b878aa409aae1d8786759e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 16 Mar 2013 23:11:07 -0400 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/decl.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ec7cd0f55e1..dc094f72848 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2013-03-16 Jason Merrill + * 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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b67978de7c0..facaae7ff19 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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, -- 2.30.2