From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76816 invoked by alias); 25 May 2015 20:14:11 -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 76806 invoked by uid 89); 25 May 2015 20:14:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f43.google.com Received: from mail-qg0-f43.google.com (HELO mail-qg0-f43.google.com) (209.85.192.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 25 May 2015 20:14:09 +0000 Received: by qgf2 with SMTP id 2so17980078qgf.3 for ; Mon, 25 May 2015 13:14:07 -0700 (PDT) X-Received: by 10.55.48.73 with SMTP id w70mr48800650qkw.49.1432584847209; Mon, 25 May 2015 13:14:07 -0700 (PDT) Received: from ?IPv6:2601:6:8380:343:a2a8:cdff:fe3e:b48? ([2601:6:8380:343:a2a8:cdff:fe3e:b48]) by mx.google.com with ESMTPSA id n72sm7383610qha.19.2015.05.25.13.14.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 13:14:06 -0700 (PDT) Message-ID: <5563828D.4090403@acm.org> Date: Mon, 25 May 2015 20:29:00 -0000 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Jason Merrill , GCC Patches Subject: Re: [C++ Patch] Fix 66243, silent cast of scoped enum References: <55625CB6.1020403@acm.org> <55637B78.5080805@redhat.com> In-Reply-To: <55637B78.5080805@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-05/txt/msg02268.txt.bz2 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. nathan