From patchwork Thu Jan 5 14:40:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 39624 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp335707wrt; Thu, 5 Jan 2023 06:48:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXuVz8lDhA6Yg2c/6ba7XpeFBiNt/jv4MzPvbD2KnVebDk7QpO38x/mITOhshMTZfI4fpeDt X-Received: by 2002:a17:906:f6c5:b0:7c1:8704:80c4 with SMTP id jo5-20020a170906f6c500b007c1870480c4mr44579644ejb.47.1672930132394; Thu, 05 Jan 2023 06:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672930132; cv=none; d=google.com; s=arc-20160816; b=aYSGP7ZZ+x4KF17vwBCVPfN6o6EKJmp5DGR+9MZf4VAT/VY/72NecxKRQc+ikHE0sp YAloth3a00h49xYwOVO1EuMZVANHhSV3W3beyfTFIBUstdBhTEVuHqTlp3npvEutYGc4 yKvlpZNBjGYPZYTPCa9Kzh7TVpis5cV1TX3HzMn/bpnVsXqaZ3i/e22ZhRQDY4iubqhk 73SI/ThJkDOP8N5k4nah23BpK3UnBvmOwnfNurQA6rFtA86/4GuqGnfrjdhNzyt2xITL bKdQUWKJiKTJzPUb47sRuhd38pk1Nj9KXIwIyMpJ5InogPhGdDvbkMxgasVrdJWcUoH1 3gZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=IQfLn/quREvs29CzYnfimi0fJgirK9bztc/vhSODQBM=; b=hH+sLA+nOnwFdC2p6VtHvtg07de+qg3xl/onnE77PoA3Ie6u+OSIXweTrCM6hvhm90 EbEA6XyqcPaR6w1hjiH/wri5DuALHVFDd2277CTRrGOTg383B4f6SwQDTbJjBj9f3lgA WgTfz8MpKrxT0jUCasw4le2txe5mUDFHyrpJvm4gJQcvoRgwVmoAd3MNaSIWb32QTnob MWKI13QCCnTwnRAzqFp5PHAWK3vIe2FJLoAqKvc8eb2hutbpHgLCyVbPcOmw7lKliX3D 8lyN/s4o4KZx1Ub95Zm0UvRnLcg5titBHO6sfW5LZoOOOJ+njgcxtMQGbtLWm7xigpsY m5Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rZc20itW; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m7-20020a170906848700b007a45e4f4ff0si29100804ejx.885.2023.01.05.06.48.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 06:48:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rZc20itW; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 973183898394 for ; Thu, 5 Jan 2023 14:44:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 973183898394 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672929848; bh=IQfLn/quREvs29CzYnfimi0fJgirK9bztc/vhSODQBM=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=rZc20itWZ6qPzPc/sNob4K2sZZJIU0PppXK9CFATHssFmEgLyv8wiDFE8lr7IuIOP MSTa9iDqXUheaJ6BMmOgeLOaT0icTCUJXAAPM9nLp8ljWcDimiMdnb0Z3N5AOycLtH XilxjMwF/zpVZSnVWmhxY3HTlStaM8TFu7k+jHKY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id C07E6385841C for ; Thu, 5 Jan 2023 14:40:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C07E6385841C Received: by mail-wr1-x432.google.com with SMTP id bn26so16867748wrb.0 for ; Thu, 05 Jan 2023 06:40:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IQfLn/quREvs29CzYnfimi0fJgirK9bztc/vhSODQBM=; b=qZaw9dxrNde2GTEtryHQTxMY7KcFkO9t2zib1F8EIvaZxeb5OWE1XHEkT4cldkYLzV BUI1gl2NcCEdVxLkL267kqOLuonoWSIeN+gVTv3CsVWWFsKohVQbLpjuy0uzOXOZBssS IFRpq4CTZILI2GD6syb0yVJqKoYm4TDLDiErWIx1Y47BpssOPJxROuLap1NjdG3sADir CIimEZRzjYnr05U9rcjlhBXV6g5Z7zY1l7aNF7ugLCsBxJqDEOUW7vN8zcRiecn9Vm1s pC+R2OXTukQkJTMjNeoJNKEE6n6nsk2+v+3qL1ic6dP77qXBAz3Zde3s6/eVrqJGzy9A bIjw== X-Gm-Message-State: AFqh2kr2AP/UB1Io2RalO0384ZZoISzw5wzVffzbEa0TiDzSW/yNA7n1 ocKtC64GmJkozADd1BWIIlRC2/MU1LR3wG4NjJ0= X-Received: by 2002:a5d:4911:0:b0:238:8896:788b with SMTP id x17-20020a5d4911000000b002388896788bmr33298281wrq.26.1672929615605; Thu, 05 Jan 2023 06:40:15 -0800 (PST) Received: from poulhies-Precision-5550.lan (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id t5-20020a5d49c5000000b0028cf987d944sm19761119wrs.33.2023.01.05.06.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 06:40:15 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Ronan Desplanques Subject: [COMMITTED] ada: Fix spurious emissions of -gnatwj warning Date: Thu, 5 Jan 2023 15:40:09 +0100 Message-Id: <20230105144009.156114-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754194386378837563?= X-GMAIL-MSGID: =?utf-8?q?1754194386378837563?= From: Ronan Desplanques Before this patch, the compiler would erroneously emit a warning about the use of parentheses for array aggregates being discouraged in some situations. Those situations were the ones where array aggregates were used as generic actuals when instantiating generic packages defined in the runtime library. This patch fixes this issue by looking at the Ada version explicitly specified by the user instead of the Ada_Version flag which is always set to the latest Ada version when compiling code from the runtime library. gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Tweak conditions for warning about use of parentheses for array aggregates. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 433f1ac84ca..958b2bbbd18 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1922,7 +1922,7 @@ package body Sem_Aggr is -- Disable the warning for GNAT Mode to allow for easier transition. - if Ada_Version >= Ada_2022 + if Ada_Version_Explicit >= Ada_2022 and then Warn_On_Obsolescent_Feature and then not GNAT_Mode and then not Is_Homogeneous_Aggregate (N)