diff options
author | Jason Merrill <jason@casey.cygnus.com> | 2000-04-20 05:53:58 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-04-20 01:53:58 -0400 |
commit | 6e9dcc25c1b16f9d2b3cb0f991f2840b0a4385e8 (patch) | |
tree | 5c00cfe370fd1a8509cf66030a91d8fa23d2eb8c /gcc | |
parent | af98124ef9a698e8b82e4e794fd421ea0ccb3054 (diff) | |
download | gcc-6e9dcc25c1b16f9d2b3cb0f991f2840b0a4385e8.zip gcc-6e9dcc25c1b16f9d2b3cb0f991f2840b0a4385e8.tar.gz gcc-6e9dcc25c1b16f9d2b3cb0f991f2840b0a4385e8.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/call.c | 5 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 5 |
4 files changed, 17 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 94c12ae..9096b12 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 1ffbf60..085e264 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 3be90dc..444b8a7 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 6b7cb69..7d12d95 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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) { |