From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74080 invoked by alias); 26 May 2015 01:10:34 -0000 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 Received: (qmail 73436 invoked by uid 89); 26 May 2015 01:10:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 26 May 2015 01:10:33 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4Q1ASGR011442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 May 2015 21:10:28 -0400 Received: from [10.10.116.39] ([10.10.116.39]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4Q1AR5n020066; Mon, 25 May 2015 21:10:28 -0400 Message-ID: <5563C7FF.6030204@redhat.com> Date: Tue, 26 May 2015 07:49:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Nathan Sidwell , GCC Patches Subject: Re: [C++ Patch] Fix 66243, silent cast of scoped enum References: <55625CB6.1020403@acm.org> <55637B78.5080805@redhat.com> <5563828D.4090403@acm.org> In-Reply-To: <5563828D.4090403@acm.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-05/txt/msg02280.txt.bz2 On 05/25/2015 04:14 PM, Nathan Sidwell wrote: > On 05/25/15 15:43, Jason Merrill wrote: >> On 05/24/2015 07:20 PM, Nathan Sidwell wrote: >>> - else if (! INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value))) >>> + else if (! INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P >>> + (TREE_TYPE (value))) >>> value = perform_implicit_conversion_flags >>> (ENUM_UNDERLYING_TYPE (enumtype), value, tf_warning_or_error, >>> LOOKUP_IMPLICIT | LOOKUP_NO_NARROWING); >> >> The change is fine, but I wonder why perform_implicit_conversion_flags >> was >> succeeding? I would think it should fail. > > It wasn't being executed. The if condition is if *NOT* > integral-or-enum. The patch changes the check such that p_i_c_f is now > executed for scoped enums -- and emits an appropriate error. Ah, of course, thanks. Jason