typeck.c (build_x_function_call): Resolve an OFFSET_REF.
authorJason Merrill <jason@casey.cygnus.com>
Thu, 20 Apr 2000 05:53:58 +0000 (05:53 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 20 Apr 2000 05:53:58 +0000 (01:53 -0400)
        * typeck.c (build_x_function_call): Resolve an OFFSET_REF.

        * call.c (joust): Exit early if we get the same function, too.

        * decl2.c (key_method): Return NULL_TREE for template classes.
        (import_export_class): Don't need to check for template classes.

From-SVN: r33273

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/decl2.c
gcc/cp/typeck.c

index 94c12ae..9096b12 100644 (file)
@@ -1,3 +1,12 @@
+2000-04-20  Jason Merrill  <jason@casey.cygnus.com>
+
+       * typeck.c (build_x_function_call): Resolve an OFFSET_REF.
+
+       * call.c (joust): Exit early if we get the same function, too.
+
+       * decl2.c (key_method): Return NULL_TREE for template classes.
+       (import_export_class): Don't need to check for template classes.
+
 2000-04-18  Zack Weinberg  <zack@wolery.cumb.org>
 
        * lex.c: Remove references to cccp.c.
index 1ffbf60..085e264 100644 (file)
@@ -4923,8 +4923,9 @@ joust (cand1, cand2, warn)
     return -1;
 
   /* If we have two pseudo-candidates for conversions to the same type,
-     arbitrarily pick one.  */
-  if (TYPE_P (cand1->fn) && cand1->fn == cand2->fn)
+     or two candidates for the same function, arbitrarily pick one.  */
+  if (cand1->fn == cand2->fn
+      && (TYPE_P (cand1->fn) || DECL_P (cand1->fn)))
     return 1;
 
   /* a viable function F1
index 3be90dc..444b8a7 100644 (file)
@@ -2422,6 +2422,7 @@ key_method (type)
   tree method;
 
   if (TYPE_FOR_JAVA (type)
+      || CLASSTYPE_TEMPLATE_INSTANTIATION (type)
       || CLASSTYPE_INTERFACE_KNOWN (type))
     return NULL_TREE;
 
@@ -2528,8 +2529,7 @@ import_export_class (ctype)
   /* Base our import/export status on that of the first non-inline,
      non-pure virtual function, if any.  */
   if (import_export == 0
-      && TYPE_POLYMORPHIC_P (ctype)
-      && ! CLASSTYPE_TEMPLATE_INSTANTIATION (ctype))
+      && TYPE_POLYMORPHIC_P (ctype))
     {
       tree method = key_method (ctype);
       if (method)
index 6b7cb69..7d12d95 100644 (file)
@@ -2574,6 +2574,9 @@ build_x_function_call (function, params, decl)
                                TYPE_BINFO (type), LOOKUP_NORMAL);
     }
     
+  if (TREE_CODE (function) == OFFSET_REF)
+    function = resolve_offset_ref (function);
+
   if ((TREE_CODE (function) == FUNCTION_DECL
        && DECL_STATIC_FUNCTION_P (function))
       || (TREE_CODE (function) == TEMPLATE_DECL
@@ -2669,8 +2672,6 @@ build_x_function_call (function, params, decl)
       return build_method_call (decl, function, params,
                                NULL_TREE, LOOKUP_NORMAL);
     }
-  else if (TREE_CODE (function) == OFFSET_REF)
-    my_friendly_abort (20000406);
   else if (TREE_CODE (function) == COMPONENT_REF
           && type == unknown_type_node)
     {