From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21890 invoked by alias); 4 Dec 2009 13:51:49 -0000 Received: (qmail 21881 invoked by uid 22791); 4 Dec 2009 13:51:47 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Dec 2009 13:51:39 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 175FA10A34; Fri, 4 Dec 2009 13:51:37 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id ED17C109F9; Fri, 4 Dec 2009 13:51:36 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1NGYZL-0001M7-V9; Fri, 04 Dec 2009 08:51:35 -0500 Date: Fri, 04 Dec 2009 13:51:00 -0000 From: Daniel Jacobowitz To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [RFA] "Sort" C++ fieldlists Message-ID: <20091204135135.GA4909@caradoc.them.org> Mail-Followup-To: Keith Seitz , gdb-patches@sourceware.org References: <4B187211.8070004@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B187211.8070004@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00051.txt.bz2 On Thu, Dec 03, 2009 at 06:21:05PM -0800, Keith Seitz wrote: > 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. I guess this is OK... it seems nicer not to impose the restriction. Is it this easy? int ii; 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)) continue; /* 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; } -- Daniel Jacobowitz CodeSourcery