decl.c (grokdeclarator): Assert that we won't see a pointer to METHOD_TYPE.
authorJason Merrill <jason@redhat.com>
Sun, 17 Mar 2013 03:11:07 +0000 (23:11 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 17 Mar 2013 03:11:07 +0000 (23:11 -0400)
* decl.c (grokdeclarator): Assert that we won't see a pointer to
METHOD_TYPE.

From-SVN: r196748

gcc/cp/ChangeLog
gcc/cp/decl.c

index ec7cd0f55e18d6ed43cf3690e2fcc0062f939d3b..dc094f7284874e81ed967344b001282c76aa1bbd 100644 (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.
index b67978de7c0113c35e9665841fc630270f2cbfeb..facaae7ff19c3e76709cf7deb067a62dbb7ba171 100644 (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,