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>
|
2000-07-14 Nicholas Duffek <nsd@redhat.com>
|
||||||
|
|
||||||
* ppcbug-rom.c (ppcbug_regnames[]): Make array size implicit.
|
* ppcbug-rom.c (ppcbug_regnames[]): Make array size implicit.
|
||||||
|
|
20
gdb/valops.c
20
gdb/valops.c
|
@ -2029,12 +2029,22 @@ typecmp (staticp, t1, t2)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (TYPE_CODE (tt1) == TYPE_CODE_PTR
|
/* djb - 20000715 - Until the new type structure is in the
|
||||||
&& (TYPE_CODE (tt2) == TYPE_CODE_ARRAY
|
place, and we can attempt things like implicit conversions,
|
||||||
|| TYPE_CODE (tt2) == TYPE_CODE_PTR))
|
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));
|
tt1 = check_typedef( TYPE_TARGET_TYPE(tt1) );
|
||||||
tt2 = check_typedef (TYPE_TARGET_TYPE (tt2));
|
}
|
||||||
|
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))
|
if (TYPE_CODE (tt1) == TYPE_CODE (tt2))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue