decl2.c (mark_member_pointers): Verify that member pointer points to the function.
authorJan Hubicka <jh@suse.cz>
Mon, 28 Jul 2003 21:59:30 +0000 (23:59 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 28 Jul 2003 21:59:30 +0000 (21:59 +0000)
* decl2.c (mark_member_pointers): Verify that member pointer points to
the function.

From-SVN: r69902

gcc/cp/ChangeLog
gcc/cp/decl2.c

index 1ca63044dcfa71d82315d91e7f7e547b03f09c09..abbe9ccbbc3245d1be3870f8c8550329e85846f7 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul 28 23:55:10 CEST 2003  Jan Hubicka  <jh@suse.cz>
+
+       * decl2.c (mark_member_pointers): Verify that member pointer points to
+       the function.
+
 2003-07-28  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cp-tree.h (begin_compound_stmt): No scope arg is a bool.
index a9f8fa88b5cadcd622ca0416f2bdcc026c1befcd..4a6e78d500f184c7b96ac6fc7caf7fbd5787ba99 100644 (file)
@@ -2594,7 +2594,8 @@ static tree
 mark_member_pointers (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
                      void *data ATTRIBUTE_UNUSED)
 {
-  if (TREE_CODE (*tp) == PTRMEM_CST)
+  if (TREE_CODE (*tp) == PTRMEM_CST
+      && TYPE_PTRMEMFUNC_P (TREE_TYPE (*tp)))
     cgraph_mark_needed_node (cgraph_node (PTRMEM_CST_MEMBER (*tp)), 1);
   return 0;
 }