From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7486 invoked by alias); 16 Sep 2019 09:22:32 -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 7477 invoked by uid 89); 16 Sep 2019 09:22:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=H*r:Gateway, eventually, H*Ad:D*oracle.com, HContent-Transfer-Encoding:8bit X-HELO: userp2120.oracle.com Received: from userp2120.oracle.com (HELO userp2120.oracle.com) (156.151.31.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Sep 2019 09:22:31 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8G9JoRY166198; Mon, 16 Sep 2019 09:22:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=ekCDuuHnfzrAL1qNrXuIr0nIgSG3X23FTEsgkcsGqcw=; b=YnXdZJXNfHPDsub4xBGyRDDVnVjTMlyhQapjxRUBB3u+5qO0cMh1S/nyRJjGatXQQSUs Yz99xVkWlt2m+5/rVPyWuWKPiINnM4KlnKsW/6E6GwAvhAhhjp5pOgT5Cl+rmncTL6dg /RIP5KcAJqMFUvhj1X17umY6FOn+R/dGUVRoEMezwmrQGbaz6VJDwHlAzxB665L9rJCH aMEWmrE6Bg9bIGEExIM/LPAxcY88BYfT5P38RdRtbCZ72KURJzE2ZlBUCjHdisV98LVZ Z+tB+ez8fHKHCWHyvq89sHxgkodGaABOaOvud+sJmK6lLmeEb1WbQzAXo+WRAaZ+O5qO Dg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2v0ruqe7bf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Sep 2019 09:22:29 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8G9JKQY123953; Mon, 16 Sep 2019 09:22:29 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2v0qhp50ub-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Sep 2019 09:22:28 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x8G9MS2x031869; Mon, 16 Sep 2019 09:22:28 GMT Received: from [192.168.1.4] (/79.19.31.88) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 16 Sep 2019 02:22:27 -0700 Subject: Re: [C++ Patch] Another bunch of location fixes To: Jason Merrill , "gcc-patches@gcc.gnu.org" References: From: Paolo Carlini Message-ID: <3c829e52-803c-f19e-470d-96cb53a33a00@oracle.com> Date: Mon, 16 Sep 2019 09:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00935.txt.bz2 Hi, On 15/09/19 16:22, Jason Merrill wrote: > On 9/12/19 9:41 AM, Paolo Carlini wrote: >> +      if (!valid_array_size_p (dname >> +                   ? declarator->id_loc : input_location, > > Use the id_loc local variable? This diagnostic is inside the loop over declarator->declarator. Eventually, outside the loop, the id_loc local is updated to the final declarator->id_loc or input_location. Norrmally in the loop we use the current declarator->id_loc: what I tested seems more correct to me (we have to account for input_location too because valid_array_size_p, shared with the C front-end, wants a sound location) Paolo.