From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18593 invoked by alias); 23 May 2011 15:02:04 -0000 Received: (qmail 18584 invoked by uid 22791); 23 May 2011 15:02:03 -0000 X-SWARE-Spam-Status: No, hits=-2.3 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-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 May 2011 15:01:48 +0000 Received: by wye20 with SMTP id 20so5157242wye.20 for ; Mon, 23 May 2011 08:01:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.195.4 with SMTP id ea4mr2347110wbb.76.1306162907201; Mon, 23 May 2011 08:01:47 -0700 (PDT) Received: by 10.227.38.129 with HTTP; Mon, 23 May 2011 08:01:47 -0700 (PDT) In-Reply-To: <4DDA743A.7000604@redhat.com> References: <4DDA743A.7000604@redhat.com> Date: Mon, 23 May 2011 15:46:00 -0000 Message-ID: Subject: Re: RFA PATCH to get_narrower for c++/48106 (ICE with scoped enum) From: Richard Guenther To: Jason Merrill Cc: gcc-patches List 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-05/txt/msg01644.txt.bz2 On Mon, May 23, 2011 at 4:50 PM, Jason Merrill wrote: > C++0x scoped enums don't implicitly convert to an integral type, so we ne= ed > to be careful about throwing away explicit conversions. =A0In this case, = the > static_cast(e) creates a NOP_EXPR which get_narrower throws away, but > 'e' itself is not a valid argument for &, so we need to replace the NOP_E= XPR > with a different one. > > Tested x86_64-pc-linux-gnu. =A0OK for trunk? Ok. Though I wonder where you enter folding before you check semantic validity. Thanks, Richard.