aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorNicholas Duffek <nsd@redhat.com>2000-07-09 05:15:50 +0000
committerNicholas Duffek <nsd@redhat.com>2000-07-09 05:15:50 +0000
commit6b1ba9a0022b6608ddf28ac2eb04d665aa06135b (patch)
treeb7f47994496524c7330ca526dc8b89af885a17b4 /gdb/valops.c
parent2bec05724f1e0b0b643a6b81ad80155d994d3ffe (diff)
downloadgdb-6b1ba9a0022b6608ddf28ac2eb04d665aa06135b.zip
gdb-6b1ba9a0022b6608ddf28ac2eb04d665aa06135b.tar.gz
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/valops.c')
-rw-r--r--gdb/valops.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index d5171a6..114a035 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2858,16 +2858,16 @@ find_overload_match (arg_types, nargs, name, method, lax, obj, fsym, valp, symp,
break;
}
free (parm_types);
-if (overload_debug)
-{
- if (method)
- fprintf_filtered (gdb_stderr,"Overloaded method instance %s, # of parms %d\n", fns_ptr[ix].physname, nparms);
- else
- fprintf_filtered (gdb_stderr,"Overloaded function instance %s # of parms %d\n", SYMBOL_DEMANGLED_NAME (oload_syms[ix]), nparms);
- for (jj = 0; jj < nargs; jj++)
- fprintf_filtered (gdb_stderr,"...Badness @ %d : %d\n", jj, bv->rank[jj]);
- fprintf_filtered (gdb_stderr,"Overload resolution champion is %d, ambiguous? %d\n", oload_champ, oload_ambiguous);
-}
+ if (overload_debug)
+ {
+ if (method)
+ fprintf_filtered (gdb_stderr,"Overloaded method instance %s, # of parms %d\n", fns_ptr[ix].physname, nparms);
+ else
+ fprintf_filtered (gdb_stderr,"Overloaded function instance %s # of parms %d\n", SYMBOL_DEMANGLED_NAME (oload_syms[ix]), nparms);
+ for (jj = 0; jj < nargs; jj++)
+ fprintf_filtered (gdb_stderr,"...Badness @ %d : %d\n", jj, bv->rank[jj]);
+ fprintf_filtered (gdb_stderr,"Overload resolution champion is %d, ambiguous? %d\n", oload_champ, oload_ambiguous);
+ }
} /* end loop over all candidates */
/* NOTE: dan/2000-03-10: Seems to be a better idea to just pick one
if they have the exact same goodness. This is because there is no
@@ -2890,15 +2890,11 @@ if (overload_debug)
/* Check how bad the best match is */
for (ix = 1; ix <= nargs; ix++)
{
- switch (oload_champ_bv->rank[ix])
- {
- case 10:
- oload_non_standard = 1; /* non-standard type conversions needed */
- break;
- case 100:
- oload_incompatible = 1; /* truly mismatched types */
- break;
- }
+ if (oload_champ_bv->rank[ix] >= 100)
+ oload_incompatible = 1; /* truly mismatched types */
+
+ else if (oload_champ_bv->rank[ix] >= 10)
+ oload_non_standard = 1; /* non-standard type conversions needed */
}
if (oload_incompatible)
{