From patchwork Mon Aug 5 21:09:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 1142474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-506264-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="B2TGV9mZ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="0hzmmxYq"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 462Vl81KsDz9sN4 for ; Tue, 6 Aug 2019 07:09:37 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=DSS2ObdM7sgRBW9rLBQCmL6x5QORoZz7k+mvo4sdfgSMi3exGQ l7dd5hPJ7B0IQehYMU+SRbyuJkJvu0VANo3pzdu5bVItCzy68siEN6ID0e6VMvSS /9LE8+UfOhRDMvx+i9zaNGBbTkEUo57a+paz6sp4auluOfVCHSdsBtrlQ= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=b87a6fBgmMTlrobw9rFGe0riwyQ=; b=B2TGV9mZfUeSj1e3VKad 7932PwQ+ANoMFBeo9AznO1vc7gq7+l2lEz63PPovoQvSOPNq9UtLbdgTeWzYwYzB Km5wUvjeXZe5bSENTTrQhipAviy1dJDwVju+0vePcb0FZ+kIbsD2P8V/uB0Lem4T R0WYxgWrobfihq4fzYdn7EY= Received: (qmail 118815 invoked by alias); 5 Aug 2019 21:09:31 -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 118807 invoked by uid 89); 5 Aug 2019 21:09:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=H*Ad:D*oracle.com, HX-Spam-Relays-External:192.168.1.4, H*r:ip*192.168.1.4, H*RU:192.168.1.4 X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Aug 2019 21:09:29 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x75L93t4146752; Mon, 5 Aug 2019 21:09:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : from : subject : message-id : date : mime-version : content-type; s=corp-2018-07-02; bh=rWfexDiRHgasBE4MhEu8ccP1Kj7YR7HJiDdsVoz5Syw=; b=0hzmmxYq9se25M8rdkblluLLqFeqGetqdQm78BHNxpbOIL2TMXPMpTi+5fxnv7pzYrzf QLBx0PUckMI5kU6hd7vlE06atLbDPF69qlxrWUiHVOYO1kGCT/493r7JufYuQJyxexHu LUlC2yuE/o6EEjochqdTZUDRPjvMVxQmpFqV+UcEfQTibDqU83ZV/PTQj3FWitpq5ZtV Oz93Fh7kvfifRatwK7/nAu5cDFnaWSibtsEYZq8QzsRj7kk4V16Y3DXsQ/E994VODvcO WFRXOdwG6hZNK2Sk05hEcyQHmtzRhm2c/WTpIv09AVI49b7kbhpNcbbr1GUO+5c2o9NN hg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2u527phq41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2019 21:09:27 +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 x75L8NL5151690; Mon, 5 Aug 2019 21:09:27 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 2u51kmwq8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Aug 2019 21:09:26 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x75L9Pdk020566; Mon, 5 Aug 2019 21:09:25 GMT Received: from [192.168.1.4] (/95.247.231.7) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Aug 2019 14:09:25 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] One more cp_expr_loc_or_input_loc Message-ID: <38ab63ad-8369-f7a8-10c0-79764c62e3e6@oracle.com> Date: Mon, 5 Aug 2019 23:09:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, just spotted an additional error which can benefit from cp_expr_loc_or_input_loc. Tested x86_64-linux. Thanks, Paolo. //////////////////// /cp 2019-08-05 Paolo Carlini * decl.c (check_array_designated_initializer): Use cp_expr_loc_or_input_loc in one place. /testsuite 2019-08-05 Paolo Carlini * g++.dg/cpp0x/desig1.C: Check location too. Index: cp/decl.c =================================================================== --- cp/decl.c (revision 274124) +++ cp/decl.c (working copy) @@ -5520,8 +5520,9 @@ check_array_designated_initializer (constructor_el sorry ("non-trivial designated initializers not supported"); } else - error ("C99 designator %qE is not an integral constant-expression", - ce->index); + error_at (cp_expr_loc_or_input_loc (ce->index), + "C99 designator %qE is not an integral constant-expression", + ce->index); return false; } Index: testsuite/g++.dg/cpp0x/desig1.C =================================================================== --- testsuite/g++.dg/cpp0x/desig1.C (revision 274123) +++ testsuite/g++.dg/cpp0x/desig1.C (working copy) @@ -25,5 +25,5 @@ struct C constexpr operator SE() const { return SE::se0; } }; -int c[] = { [C()] = 0 }; // { dg-error "integral constant-expression" } +int c[] = { [C()] = 0 }; // { dg-error "14:C99 designator .C\\\(\\\). is not an integral constant-expression" } // { dg-warning "does not allow C99 designated initializers" "" { target *-*-* } .-1 }