From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6506 invoked by alias); 8 Mar 2011 21:48:25 -0000 Received: (qmail 6497 invoked by uid 22791); 8 Mar 2011 21:48:25 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Mar 2011 21:48:21 +0000 Received: by qwi2 with SMTP id 2so4890932qwi.20 for ; Tue, 08 Mar 2011 13:48:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.78.221 with SMTP id m29mr4540597qck.19.1299620899079; Tue, 08 Mar 2011 13:48:19 -0800 (PST) Received: by 10.229.251.8 with HTTP; Tue, 8 Mar 2011 13:48:19 -0800 (PST) In-Reply-To: <4D7297F5.2000708@redhat.com> References: <4C0EB10C.3050701@redhat.com> <4C1AD953.3020008@redhat.com> <4C6E0571.3070802@redhat.com> <4D1279FD.6010706@redhat.com> <4D7297F5.2000708@redhat.com> Date: Tue, 08 Mar 2011 21:48:00 -0000 Message-ID: Subject: Re: [Patch] PR c++/26256 From: =?ISO-8859-1?Q?Fabien_Ch=EAne?= To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 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: 2011-03/txt/msg00434.txt.bz2 2011/3/5 Jason Merrill : > On 03/04/2011 03:11 AM, Fabien Ch=EAne wrote: >> >> Hmm, I've implemented what you were suggesting, and I don't understand >> the following check in supplement_binding: >> >> else if (TREE_CODE (bval) =3D=3D TYPE_DECL&& =A0DECL_ARTIFICIAL (bval)) >> =A0 =A0 { >> =A0 =A0 =A0 /* The old binding was a type name. =A0It was placed in >> =A0 =A0 =A0 =A0 VALUE field because it was thought, at the point it was >> =A0 =A0 =A0 =A0 declared, to be the only entity with such a name. =A0Mov= e the >> =A0 =A0 =A0 =A0 type name into the type slot; it is now hidden by the new >> =A0 =A0 =A0 =A0 binding. =A0*/ >> =A0 =A0 =A0 binding->type =3D bval; >> =A0 =A0 =A0 binding->value =3D decl; >> =A0 =A0 =A0 binding->value_is_inherited =3D false; >> =A0 =A0 } >> >> Why is it usefull ? It prevents the following illegal code from being >> rejected: >> >> struct A >> { >> =A0 =A0 struct type {}; >> =A0 =A0 typedef int type; >> }; > > That's a bug. =A0I guess the check above needs to make sure that decl is = not a > TYPE_DECL. OK, FYI I have opened PR c++/48010 for this bug, which I am going to fix fi= rst. --=20 Fabien