From: Daniel Jacobowitz <drow@false.org>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] "Sort" C++ fieldlists
Date: Fri, 04 Dec 2009 20:54:00 -0000 [thread overview]
Message-ID: <20091204205442.GA3736@caradoc.them.org> (raw)
In-Reply-To: <4B194785.6090801@redhat.com>
On Fri, Dec 04, 2009 at 09:31:49AM -0800, Keith Seitz wrote:
> Yes, actually it *is* that simple. Or at least none of my testing can
> prove that your (much) simpler patch is any less effective than my
> more complicated one.
I've tested and committed this, then.
--
Daniel Jacobowitz
CodeSourcery
2009-12-04 Daniel Jacobowitz <dan@codesourcery.com>
* valops.c (value_struct_elt_for_reference): Do not rely on
field order.
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.228
diff -u -p -r1.228 valops.c
--- valops.c 2 Dec 2009 19:29:42 -0000 1.228
+++ valops.c 4 Dec 2009 20:25:44 -0000
@@ -2700,29 +2700,31 @@ value_struct_elt_for_reference (struct t
}
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);
-
- /* This assumes, of course, that all artificial methods appear
- BEFORE any concrete methods. */
- j = TYPE_FN_FIELDLIST_LENGTH (t, i) - 1;
+ /* Desired method is ambiguous if more than one
+ method is defined. */
+ if (j != -1)
+ error (_("non-unique member `%s' requires type instantiation"), name);
+
+ j = ii;
+ }
}
if (TYPE_FN_FIELD_STATIC_P (f, j))
prev parent reply other threads:[~2009-12-04 20:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 2:21 Keith Seitz
2009-12-04 13:51 ` Daniel Jacobowitz
2009-12-04 17:32 ` Keith Seitz
2009-12-04 20:54 ` Daniel Jacobowitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091204205442.GA3736@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox