From patchwork Sat Mar 16 18:46:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 228237 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6C6C42C009A for ; Sun, 17 Mar 2013 05:47:24 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1364064445; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=ftUeRre46QkOtA0GGFAhNTwfYMA=; b=RuLyB4rYhrUoQ6x 9s2bWO4GszUVihRvyoueSyVCh/O8tCpfBaIrDKept0Sr6bBt7Pw2GVINDB9dJpSU 1HRnH5dfDM8Gygm/oURYpeRt5V3JrFkUGXEwRV/xLWmeRFtEULivyGRoGWwL4kO2 COjrPI4DyB2oUrCIv/PAZGBIk59U= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=FCKMD8sQqSOz6EiW9BSSOFqOf60vmJmv1n2vF2wpKBCzZCKShyncjOcPzYItcO 4bExuykcYEekbmBA+w/eOSlkXbx0AW2gOd2Of7healFLB/m8y0L6x9icWtA7RzCs OA85LStzcD1Lve4CE3Bo5SI3N31R0B6ugt342TlATNC6w=; Received: (qmail 19364 invoked by alias); 16 Mar 2013 18:47:15 -0000 Received: (qmail 19342 invoked by uid 22791); 16 Mar 2013 18:47:11 -0000 X-SWARE-Spam-Status: No, hits=-8.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Mar 2013 18:47:00 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2GIl0cn027197 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 16 Mar 2013 14:47:00 -0400 Received: from [10.3.113.72] (ovpn-113-72.phx2.redhat.com [10.3.113.72]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2GIkxhU016010 for ; Sat, 16 Mar 2013 14:46:59 -0400 Message-ID: <5144BE23.6070906@redhat.com> Date: Sat, 16 Mar 2013 14:46:59 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:21.0) Gecko/20100101 Thunderbird/21.0a2 MIME-Version: 1.0 To: gcc-patches List Subject: Re: C++ PATCH for c++/56238 (ice-checking with static_cast) References: <5116B35D.8050500@redhat.com> In-Reply-To: <5116B35D.8050500@redhat.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 02/09/2013 03:36 PM, Jason Merrill wrote: > The code in build_non_dependent_expr has caught a number of issues in > the compiler; this is another case that fold_non_dependent_expr wasn't > properly recognizing as dependent. I think we want to use > instantiation_dependent there going forward, but for 4.8 I think let's > just check it in the ENABLE_CHECKING code. Now that we're in stage 1 again, let's make that change. Tested x86_64-pc-linux-gnu, applying to trunk. commit d76feeb24741fabc5ebbf1d46b8eaf8ac8006b10 Author: Jason Merrill Date: Thu Feb 7 12:49:05 2013 -0500 PR c++/56238 * pt.c (fold_non_dependent_expr_sfinae): Check instantiation_dependent_expression_p. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 36175ca..6264add 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5044,9 +5044,8 @@ fold_non_dependent_expr_sfinae (tree expr, tsubst_flags_t complain) as two declarations of the same function, for example. */ if (processing_template_decl - && !type_dependent_expression_p (expr) - && potential_constant_expression (expr) - && !value_dependent_expression_p (expr)) + && !instantiation_dependent_expression_p (expr) + && potential_constant_expression (expr)) { HOST_WIDE_INT saved_processing_template_decl;