aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2009-12-04 20:26:33 +0000
committerDaniel Jacobowitz <drow@false.org>2009-12-04 20:26:33 +0000
commit7f79b1c54fb397e812c08374db2be5769908889d (patch)
treeb36294e00ed16bf925481d99f04f5098ba41d8bc /gdb/valops.c
parent28e67f5d7578ff0e31087d70bbdf5701852e92c2 (diff)
downloadgdb-7f79b1c54fb397e812c08374db2be5769908889d.zip
gdb-7f79b1c54fb397e812c08374db2be5769908889d.tar.gz
gdb-7f79b1c54fb397e812c08374db2be5769908889d.tar.bz2
* valops.c (value_struct_elt_for_reference): Do not rely on
field order.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 34619d3..99c99f1 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2700,29 +2700,31 @@ value_struct_elt_for_reference (struct type *domain, int offset,
}
if (j == len)
- error (_("no member function matches that type instantiation")); }
+ error (_("no member function matches that type instantiation"));
+ }
else
{
int ii;
- /* Skip artificial methods. This is necessary if, for example,
- the user wants to "print subclass::subclass" with only
- one user-defined constructor. There is no ambiguity in this
- case. */
+
+ j = -1;
for (ii = 0; ii < TYPE_FN_FIELDLIST_LENGTH (t, i);
++ii)
{
+ /* Skip artificial methods. This is necessary if,
+ for example, the user wants to "print
+ subclass::subclass" with only one user-defined
+ constructor. There is no ambiguity in this
+ case. */
if (TYPE_FN_FIELD_ARTIFICIAL (f, ii))
- --len;
- }
+ continue;
- /* Desired method is ambiguous if more than one method is
- defined. */
- if (len > 1)
- error (_("non-unique member `%s' requires type instantiation"), name);
+ /* Desired method is ambiguous if more than one
+ method is defined. */
+ if (j != -1)
+ error (_("non-unique member `%s' requires type instantiation"), name);
- /* This assumes, of course, that all artificial methods appear
- BEFORE any concrete methods. */
- j = TYPE_FN_FIELDLIST_LENGTH (t, i) - 1;
+ j = ii;
+ }
}
if (TYPE_FN_FIELD_STATIC_P (f, j))