diff options
author | Nicholas Duffek <nsd@redhat.com> | 2000-07-09 05:15:50 +0000 |
---|---|---|
committer | Nicholas Duffek <nsd@redhat.com> | 2000-07-09 05:15:50 +0000 |
commit | 6b1ba9a0022b6608ddf28ac2eb04d665aa06135b (patch) | |
tree | b7f47994496524c7330ca526dc8b89af885a17b4 /gdb/gdbtypes.c | |
parent | 2bec05724f1e0b0b643a6b81ad80155d994d3ffe (diff) | |
download | fsf-binutils-gdb-6b1ba9a0022b6608ddf28ac2eb04d665aa06135b.zip fsf-binutils-gdb-6b1ba9a0022b6608ddf28ac2eb04d665aa06135b.tar.gz fsf-binutils-gdb-6b1ba9a0022b6608ddf28ac2eb04d665aa06135b.tar.bz2 |
* gdbtypes.c (is_ancestor): Infer type equivalence from name
equivalence.
(rank_one_type): Use strcmp instead of == to compare type names.
Don't swap parm with arg when checking TYPE_CODE_REF types.
* valops.c (find_overload_match): Fix indentation. Compare
parameter rankings to 0..9, 10..99, and 100+ instead of 0, 10,
and 100.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r-- | gdb/gdbtypes.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 0f6eef9..3ca1b33 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1736,6 +1736,9 @@ is_ancestor (base, dclass) if (base == dclass) return 1; + if (TYPE_NAME (base) && TYPE_NAME (dclass) && + !strcmp (TYPE_NAME (base), TYPE_NAME (dclass))) + return 1; for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++) if (is_ancestor (base, TYPE_BASECLASS (dclass, i))) @@ -2206,7 +2209,8 @@ rank_one_type (parm, arg) really are the same. */ - if (TYPE_NAME (parm) == TYPE_NAME (arg)) + if (TYPE_NAME (parm) && TYPE_NAME (arg) && + !strcmp (TYPE_NAME (parm), TYPE_NAME (arg))) return 0; /* Check if identical after resolving typedefs */ @@ -2216,10 +2220,10 @@ rank_one_type (parm, arg) /* See through references, since we can almost make non-references references. */ if (TYPE_CODE (arg) == TYPE_CODE_REF) - return (rank_one_type (TYPE_TARGET_TYPE (arg), parm) + return (rank_one_type (parm, TYPE_TARGET_TYPE (arg)) + REFERENCE_CONVERSION_BADNESS); if (TYPE_CODE (parm) == TYPE_CODE_REF) - return (rank_one_type (arg, TYPE_TARGET_TYPE (parm)) + return (rank_one_type (TYPE_TARGET_TYPE (parm), arg) + REFERENCE_CONVERSION_BADNESS); if (overload_debug) /* Debugging only. */ |