summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorswagiaal <swagiaal>2010-11-04 20:43:22 +0000
committerswagiaal <swagiaal>2010-11-04 20:43:22 +0000
commitf8d20ee4a41ea7149ac8bd4f78a0316e3ac059b4 (patch)
treec90849e9751b002de49bb2adaa2951440ed06639 /gdb/gdbtypes.h
parent2a19fb230b8ee399551804ee86727c4d9ad31e1c (diff)
downloadgdb-f8d20ee4a41ea7149ac8bd4f78a0316e3ac059b4.tar.gz
Fix derived class overload problem.
2010-11-04 Sami Wagiaalla <swagiaal@redhat.com> * gdbtypes.h (struct rank): Created subrank. * gdbtypes.c: Initialized subrank for all 'BADNESS' constants. (distance_to_ancestor): New function. (is_ancestor): Use distance_to_ancestor. (is_public_ancestor): Ditto. (sum_ranks): Handle subrank. (compare_ranks): Ditto. (rank_one_type): Subrank base conversions. 2010-11-04 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/overload.exp: Added test for inheritance overload. * gdb.cp/overload.cc: Ditto. * gdb.cp/oranking.exp: Removed releveant kfails.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 8ce2c82f579..51eb4456e40 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -852,7 +852,15 @@ struct vbase
/* Struct used to store conversion rankings. */
struct rank
{
- int rank;
+ short rank;
+
+ /* When two conversions are of the same type and therefore have the same
+ rank, subrank is used to differentiate the two.
+ Eg: Two derived-class-pointer to base-class-pointer conversions would
+ both have base pointer conversion rank, but the conversion with the
+ shorter distance to the ancestor is preferable. 'subrank' would be used
+ to reflect that. */
+ short subrank;
};
/* Struct used for ranking a function for overload resolution */