From patchwork Thu Nov 7 19:50:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 289471 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 594602C00AC for ; Fri, 8 Nov 2013 06:51:13 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=Cs6rkPOOsGAO0OLed bIZgWKeKberzrCef8rvhaohVWLGKFg0NmQMRs67OEheIE5oddUVKHhATT1wu8oUb hP7xApeK+8r7m0UyeVjDFFNfmLpyaa39a7ZRvkWqJ/goBBi2WiCshwL//+LT19FQ uMziK8z2NSJzxwvaaUdcMJK5fI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=RcQgU3/q6FEVbxndNcOHLqE /T3A=; b=g+sUEAiqDSjknu+nGohi9eLFyRvgH02vLamqbCGXRCTu6zTjeILCIjs fNP42c63NWt81lDEITgO6X7CcY2Km7zTn19TRVbMudsJ2rxUxcZAI+gbwzbDfqgf x+Y7fuplyav77hLoNKSCynlWrfiEA5mQh10Pj/yVRtIyasx2VY94= Received: (qmail 16310 invoked by alias); 7 Nov 2013 19:51:03 -0000 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 Received: (qmail 16299 invoked by uid 89); 7 Nov 2013 19:51:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL, BAYES_50, RDNS_NONE, SPAM_SUBJECT, SPF_PASS, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: aserp1040.oracle.com Received: from Unknown (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 07 Nov 2013 19:50:50 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rA7JofAZ009837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Nov 2013 19:50:42 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rA7JoeZA000855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Nov 2013 19:50:41 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rA7Joe1j025991; Thu, 7 Nov 2013 19:50:40 GMT Received: from poldo4.casa (/79.45.212.108) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Nov 2013 11:50:40 -0800 Message-ID: <527BEF0E.6030409@oracle.com> Date: Thu, 07 Nov 2013 20:50:38 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: Re: [C++ Patch / RFC] Fixing a diagnostic regression caused by the fix for c++/56930 References: <527BE347.5090307@oracle.com> In-Reply-To: <527BE347.5090307@oracle.com> X-IsSubscribed: yes ... well, something like this seems better to me. Only lightly tested so far, sorry. Paolo. /////////////////////// Index: cvt.c =================================================================== --- cvt.c (revision 204536) +++ cvt.c (working copy) @@ -621,24 +621,25 @@ cp_convert_and_check (tree type, tree expr, tsubst if (TREE_TYPE (expr) == type) return expr; - - result = cp_convert (type, expr, complain); if ((complain & tf_warning) && c_inhibit_evaluation_warnings == 0) { tree folded = maybe_constant_value (expr); tree stripped = folded; - tree folded_result = cp_convert (type, folded, complain); + result = cp_convert (type, folded, complain); + /* maybe_constant_value wraps an INTEGER_CST with TREE_OVERFLOW in a NOP_EXPR so that it isn't TREE_CONSTANT anymore. */ STRIP_NOPS (stripped); if (!TREE_OVERFLOW_P (stripped) - && folded_result != error_mark_node) - warnings_for_convert_and_check (type, folded, folded_result); + && result != error_mark_node) + warnings_for_convert_and_check (type, folded, result); } + else + result = cp_convert (type, expr, complain); return result; }