]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (is_overloaded_fn): Don't abort on placeholders from push_class_decls.
authorJason Merrill <jason@yorick.cygnus.com>
Tue, 19 May 1998 20:38:04 +0000 (20:38 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 19 May 1998 20:38:04 +0000 (16:38 -0400)
* tree.c (is_overloaded_fn): Don't abort on placeholders from
push_class_decls.

From-SVN: r19888

gcc/cp/ChangeLog
gcc/cp/search.c
gcc/cp/tree.c

index 991ed6f6c793dad9deb4683d38e042f16b8a5b89..13e1312a09fcb681ae8a4732ea7fc2e277606e23 100644 (file)
@@ -1,3 +1,8 @@
+Tue May 19 20:36:23 1998  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * tree.c (is_overloaded_fn): Don't abort on placeholders from
+       push_class_decls.
+
 Tue May 19 15:16:22 1998  Brendan Kehoe  <brendan@cygnus.com>
 
        * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
index c4b1b6729d657ecc28c2c739c584d70c4bab40f7..1a779138f38094f5c679afc70ecfa4264b4b9c98 100644 (file)
@@ -3495,7 +3495,11 @@ dfs_pushdecls (binfo)
             If we can't do that, keep a TREE_LIST with possibly ambiguous
             decls in there.  */
          maybe_push_cache_obstack ();
-         envelope_add_decl (type, OVL_CURRENT (*methods), &TREE_PURPOSE (class_value));
+         /* Arbitrarily choose the first function in the list.  This is OK
+            because this is only used for initial lookup; anything that
+            actually uses the function will look it up again.  */
+         envelope_add_decl (type, OVL_CURRENT (*methods),
+                            &TREE_PURPOSE (class_value));
          pop_obstacks ();
 
          methods++;
index f2dd941fbb9d7d06d8dc952f54eb7d75d4f7cbd4..60d20b3f2588e64b225ea3bb667eb0e002459e3b 100644 (file)
@@ -1311,10 +1311,13 @@ int
 is_overloaded_fn (x)
      tree x;
 {
-  /* XXX A baselink is also considered an overloaded function. */
+  /* XXX A baselink is also considered an overloaded function.
+     As is a placeholder from push_class_decls.  */
   if (TREE_CODE (x) == TREE_LIST)
     {
-      my_friendly_assert (TREE_CODE (TREE_PURPOSE (x)) == TREE_VEC, 388);
+      my_friendly_assert (TREE_CODE (TREE_PURPOSE (x)) == TREE_VEC
+                         || TREE_CODE (TREE_PURPOSE (x)) == IDENTIFIER_NODE,
+                         388);
       x = TREE_VALUE (x);
     }
   return (TREE_CODE (x) == FUNCTION_DECL