Commit 6e9dcc25 by Jason Merrill Committed by Jason Merrill

typeck.c (build_x_function_call): Resolve an OFFSET_REF.

        * 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
parent af98124e
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> 2000-04-18 Zack Weinberg <zack@wolery.cumb.org>
* lex.c: Remove references to cccp.c. * lex.c: Remove references to cccp.c.
......
...@@ -4923,8 +4923,9 @@ joust (cand1, cand2, warn) ...@@ -4923,8 +4923,9 @@ joust (cand1, cand2, warn)
return -1; return -1;
/* If we have two pseudo-candidates for conversions to the same type, /* If we have two pseudo-candidates for conversions to the same type,
arbitrarily pick one. */ or two candidates for the same function, arbitrarily pick one. */
if (TYPE_P (cand1->fn) && cand1->fn == cand2->fn) if (cand1->fn == cand2->fn
&& (TYPE_P (cand1->fn) || DECL_P (cand1->fn)))
return 1; return 1;
/* a viable function F1 /* a viable function F1
......
...@@ -2422,6 +2422,7 @@ key_method (type) ...@@ -2422,6 +2422,7 @@ key_method (type)
tree method; tree method;
if (TYPE_FOR_JAVA (type) if (TYPE_FOR_JAVA (type)
|| CLASSTYPE_TEMPLATE_INSTANTIATION (type)
|| CLASSTYPE_INTERFACE_KNOWN (type)) || CLASSTYPE_INTERFACE_KNOWN (type))
return NULL_TREE; return NULL_TREE;
...@@ -2528,8 +2529,7 @@ import_export_class (ctype) ...@@ -2528,8 +2529,7 @@ import_export_class (ctype)
/* Base our import/export status on that of the first non-inline, /* Base our import/export status on that of the first non-inline,
non-pure virtual function, if any. */ non-pure virtual function, if any. */
if (import_export == 0 if (import_export == 0
&& TYPE_POLYMORPHIC_P (ctype) && TYPE_POLYMORPHIC_P (ctype))
&& ! CLASSTYPE_TEMPLATE_INSTANTIATION (ctype))
{ {
tree method = key_method (ctype); tree method = key_method (ctype);
if (method) if (method)
......
...@@ -2574,6 +2574,9 @@ build_x_function_call (function, params, decl) ...@@ -2574,6 +2574,9 @@ build_x_function_call (function, params, decl)
TYPE_BINFO (type), LOOKUP_NORMAL); TYPE_BINFO (type), LOOKUP_NORMAL);
} }
if (TREE_CODE (function) == OFFSET_REF)
function = resolve_offset_ref (function);
if ((TREE_CODE (function) == FUNCTION_DECL if ((TREE_CODE (function) == FUNCTION_DECL
&& DECL_STATIC_FUNCTION_P (function)) && DECL_STATIC_FUNCTION_P (function))
|| (TREE_CODE (function) == TEMPLATE_DECL || (TREE_CODE (function) == TEMPLATE_DECL
...@@ -2669,8 +2672,6 @@ build_x_function_call (function, params, decl) ...@@ -2669,8 +2672,6 @@ build_x_function_call (function, params, decl)
return build_method_call (decl, function, params, return build_method_call (decl, function, params,
NULL_TREE, LOOKUP_NORMAL); NULL_TREE, LOOKUP_NORMAL);
} }
else if (TREE_CODE (function) == OFFSET_REF)
my_friendly_abort (20000406);
else if (TREE_CODE (function) == COMPONENT_REF else if (TREE_CODE (function) == COMPONENT_REF
&& type == unknown_type_node) && type == unknown_type_node)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment