This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] "Sort" C++ fieldlists


Hi,

My method overload resolution patch was committed with the following comment (from value_struct_elt_for_reference):

  /* This assumes, of course, that all artificial methods appear
     BEFORE any concrete methods.  */

Turns out that isn't a really great assumption. In particular, it fails on GCC 3.4.6. So I'm requesting that the attached patch be approved. The patch inserts artificial methods into the type's fieldlist starting at index 0 and concrete methods starting at the end index.

This shows no regressions (and no advantages) using GCC on linux. However, if you run cpexprs.exp, this patch will fix 17 failures with GCC 3.4.6. At the worst, consider this a defensive patch against breaking the value_struct_elt_for_reference assumption.

Keith

ChangeLog
2009-12-03  Keith Seitz  <keiths@redhat.com>

	* dwarf2read.c (dwarf2_attach_fn_fields_to_type): Ensure
	that artificial methods are inserted into the fn fieldlist
	before concrete methods.
	* valops.c (value_struct_elt_for_reference): Update comments
	concerning above assumption.

Attachment: sort-methods.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]