From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47643 invoked by alias); 30 Apr 2015 19:42:12 -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 47631 invoked by uid 89); 30 Apr 2015 19:42:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 30 Apr 2015 19:42:11 +0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t3UJg7Yb015801 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 30 Apr 2015 19:42:08 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t3UJg7jW029045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 30 Apr 2015 19:42:07 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t3UJg5v0011447; Thu, 30 Apr 2015 19:42:06 GMT Received: from [192.168.1.4] (/79.33.215.240) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Apr 2015 12:42:05 -0700 Message-ID: <5542858A.7050703@oracle.com> Date: Thu, 30 Apr 2015 20:44:00 -0000 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Prathamesh Kulkarni , gcc Patches , Jason Merrill Subject: Re: [C++ patch] PR 65858 References: <55426B9A.4010406@oracle.com> <55427865.8020601@oracle.com> In-Reply-To: <55427865.8020601@oracle.com> Content-Type: multipart/mixed; boundary="------------060300090905050600070107" X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg02092.txt.bz2 This is a multi-part message in MIME format. --------------060300090905050600070107 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 387 Hi again, On 04/30/2015 08:45 PM, Paolo Carlini wrote: > .. also, your patch doesn't seem to fix the case of -w instead of > -Wno-narrowing. I think we want to check the return value of the > pedwarn instead. I'm testing something. I'm finishing testing the below: with hindsight, checking the return value of the pedwarn makes a lot of sense to me! Paolo. /////////////////////// --------------060300090905050600070107 Content-Type: text/plain; charset=UTF-8; name="patch_65858" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_65858" Content-length: 1103 Index: cp/typeck2.c =================================================================== --- cp/typeck2.c (revision 222628) +++ cp/typeck2.c (working copy) @@ -959,9 +959,10 @@ check_narrowing (tree type, tree init, tsubst_flag else if (complain & tf_error) { global_dc->pedantic_errors = 1; - pedwarn (EXPR_LOC_OR_LOC (init, input_location), OPT_Wnarrowing, - "narrowing conversion of %qE from %qT to %qT inside { }", - init, ftype, type); + if (!pedwarn (EXPR_LOC_OR_LOC (init, input_location), OPT_Wnarrowing, + "narrowing conversion of %qE from %qT to %qT " + "inside { }", init, ftype, type)) + ok = true; global_dc->pedantic_errors = flag_pedantic_errors; } } Index: testsuite/g++.dg/cpp0x/Wnarrowing4.C =================================================================== --- testsuite/g++.dg/cpp0x/Wnarrowing4.C (revision 0) +++ testsuite/g++.dg/cpp0x/Wnarrowing4.C (working copy) @@ -0,0 +1,6 @@ +// PR c++/65858 +// { dg-do compile { target c++11 } } +// { dg-require-effective-target lto } +// { dg-options "-flto -Wno-narrowing" } + +int x { 0.5 }; --------------060300090905050600070107--