From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15211 invoked by alias); 17 Jun 2010 07:39:39 -0000 Received: (qmail 15202 invoked by uid 22791); 17 Jun 2010 07:39:38 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Jun 2010 07:39:32 +0000 Received: by wyb39 with SMTP id 39so2852185wyb.20 for ; Thu, 17 Jun 2010 00:39:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.93.73 with SMTP id k51mr1650086wef.20.1276759930132; Thu, 17 Jun 2010 00:32:10 -0700 (PDT) Received: by 10.216.12.15 with HTTP; Thu, 17 Jun 2010 00:32:10 -0700 (PDT) In-Reply-To: References: <4C0EB10C.3050701@redhat.com> Date: Thu, 17 Jun 2010 08:39:00 -0000 Message-ID: Subject: Re: [Patch] PR c++/26256 From: =?UTF-8?Q?Fabien_Ch=C3=AAne?= To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg01717.txt.bz2 Arf, I boostraped it again yesterday and 02.gch ICEd. The algorithm recursing on bases isn't correct, I will fix it. And ... I've also forgotten to add the testcase for intermediate bases in the patch. 2010/6/16 Fabien Ch=C3=AAne : > Hi, > > Here is an updated patch that should address some (all ?) issues you > have noticed. > > [...] >> It seems like this only works if there is a using in the most derived cl= ass; >> a using in an intermediate class wouldn't avoid the ambiguity. >> >> I'd prefer to tear out the old access declaration code and actually hand= le >> USING_DECLs directly in lookup_field_r et al. > > I have moved the call to disambiguate_with_using_decl in > lookup_field_r, which simplify things, thanks. > disambiguate_with_using_decl has also been improved so that it can > look for a using decl in an intermediate base class. Basically, it > recurses on bases provided all using decl context classes are a base > for the current class. > > [...] >> @@ -1431,6 +1431,8 @@ dbxout_type_fields (tree type) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 || TREE_CODE (tem) =3D=3D USING_DECL > >> This will break bootstrap when C++ isn't enabled. =C2=A0Instead, check T= REE_CODE > END_OF_BASE_TREE_CODES. > > Sounds like it doesn't work. Instead, I've checked TREE_CODE >=3D > LAST_AND_UNUSED_TREE_CODE. > > Bootstrapped with all default languages, and with C only. > Tested x86_64-unknown-linux-gnu. > > OK for trunk ? > > > gcc/ChangeLog > > 2010-06-15 =C2=A0Fabien Ch=C3=AAne =C2=A0 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0PR c++/26256 > =C2=A0 =C2=A0 =C2=A0 =C2=A0* dbxout.c (dbxout_type_fields): Ignore using = declarations. > > > gcc/testsuite/ChangeLog > > 2010-06-15 =C2=A0Fabien Ch=C3=AAne =C2=A0 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0PR c++/26256 > =C2=A0 =C2=A0 =C2=A0 =C2=A0* g++.dg/lookup/using23.C: New. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* g++.dg/lookup/using24.C: New. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* g++.dg/lookup/using25.C: New. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* g++.dg/lookup/using26.C: New. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* g++.dg/lookup/using27.C: New. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* g++.dg/debug/using4.C: New. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* g++.dg/debug/using5.C: New. > > gcc/cp/ChangeLog > > 2010-06-15 =C2=A0Fabien Ch=C3=AAne =C2=A0 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0PR c++/26256 > =C2=A0 =C2=A0 =C2=A0 =C2=A0* search.c (disambiguate_with_using_decl): Def= ine. Try to > =C2=A0 =C2=A0 =C2=A0 =C2=A0disambiguate a field type or a field decl with= using declarations. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(lookup_field_r): Call disambiguate_with_using= _decl when an > =C2=A0 =C2=A0 =C2=A0 =C2=A0ambiguity has been encountered. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* class.c (count_fields): Ignore using declara= tions. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(add_fields_to_record_type): Likewise. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(check_field_decls): Keep using declarations. > > > -- > Fabien > --=20 Fabien