From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15117 invoked by alias); 15 Jun 2011 17:58:26 -0000 Received: (qmail 15107 invoked by uid 22791); 15 Jun 2011 17:58:25 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Jun 2011 17:58:11 +0000 Received: by qyk35 with SMTP id 35so2186911qyk.20 for ; Wed, 15 Jun 2011 10:58:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.40.139 with SMTP id k11mr16859qce.135.1308160690868; Wed, 15 Jun 2011 10:58:10 -0700 (PDT) Received: by 10.229.30.7 with HTTP; Wed, 15 Jun 2011 10:58:10 -0700 (PDT) In-Reply-To: References: <4C0EB10C.3050701@redhat.com> <4C1AD953.3020008@redhat.com> <4C6E0571.3070802@redhat.com> <4D1279FD.6010706@redhat.com> <4D7297F5.2000708@redhat.com> Date: Wed, 15 Jun 2011 19:42: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 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-06/txt/msg01178.txt.bz2 Hi, After updating the patch, I now see a failure on c++0x forward enums. Consider the below code: template struct S1 { enum class E1; enum class E1; }; Currently, the second declaration of E1 relies on a successfull call to supplement_binding_1. With the patch I am working on, it no longer succeeds, because a new check is needed, in order to fail if (target_)bval is a type (nearly similar to the fix for c++/48010). if (TREE_CODE (target_decl) == TYPE_DECL && DECL_ARTIFICIAL (target_decl) && (TREE_CODE (target_bval) != TYPE_DECL I don't really see a good solution to make it work. As I already did for c++/48010, we can add the below check... || same_type_p (TREE_TYPE (target_decl), TREE_TYPE (target_bval) But, same_type_p does not returns true, and it seems difficult to make it return true because the underlying type of the DECL is not yet set when calling pushtag1 in start_enum. Otherwise, perhaps that it would be better if the second declaration of E1 does not rely on supplement_binding_1. What do you think ? -- Fabien