Properly handle references
This commit is contained in:
parent
63bf565122
commit
802db21b61
|
@ -1,3 +1,10 @@
|
|||
2000-07-15 Daniel Berlin <dberlin@redhat.com>
|
||||
|
||||
* valops.c (typecmp): Seperate loop into two, add support for
|
||||
references. This way, we can say a reference to a pointer to a
|
||||
char is compatible with a pointer to a char. Before, this would
|
||||
not be true.
|
||||
|
||||
2000-07-14 Nicholas Duffek <nsd@redhat.com>
|
||||
|
||||
* ppcbug-rom.c (ppcbug_regnames[]): Make array size implicit.
|
||||
|
|
16
gdb/valops.c
16
gdb/valops.c
|
@ -2029,11 +2029,21 @@ typecmp (staticp, t1, t2)
|
|||
continue;
|
||||
}
|
||||
|
||||
while (TYPE_CODE (tt1) == TYPE_CODE_PTR
|
||||
&& (TYPE_CODE (tt2) == TYPE_CODE_ARRAY
|
||||
|| TYPE_CODE (tt2) == TYPE_CODE_PTR))
|
||||
/* djb - 20000715 - Until the new type structure is in the
|
||||
place, and we can attempt things like implicit conversions,
|
||||
we need to do this so you can take something like a map<const
|
||||
char *>, and properly access map["hello"], because the
|
||||
argument to [] will be a reference to a pointer to a char,
|
||||
and the arrgument will be a pointer to a char. */
|
||||
while ( TYPE_CODE(tt1) == TYPE_CODE_REF ||
|
||||
TYPE_CODE (tt1) == TYPE_CODE_PTR)
|
||||
{
|
||||
tt1 = check_typedef( TYPE_TARGET_TYPE(tt1) );
|
||||
}
|
||||
while ( TYPE_CODE(tt2) == TYPE_CODE_ARRAY ||
|
||||
TYPE_CODE(tt2) == TYPE_CODE_PTR ||
|
||||
TYPE_CODE(tt2) == TYPE_CODE_REF)
|
||||
{
|
||||
tt2 = check_typedef( TYPE_TARGET_TYPE(tt2) );
|
||||
}
|
||||
if (TYPE_CODE (tt1) == TYPE_CODE (tt2))
|
||||
|
|
Loading…
Reference in New Issue