From patchwork Mon May 29 08:29:23 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: 100154 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1364198vqr; Mon, 29 May 2023 01:39:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4E4CfVUc9aCpUEhhDLVVORSoG8tz8LmuoEJsgW419MCvZHDr6noHWBc48dUsE9kS1mGFBr X-Received: by 2002:a17:907:2682:b0:96a:4f89:38f8 with SMTP id bn2-20020a170907268200b0096a4f8938f8mr9110180ejc.16.1685349590055; Mon, 29 May 2023 01:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685349590; cv=none; d=google.com; s=arc-20160816; b=CT8GiKTRTUAqEiQVsEkFi13n4/TFGMArwfZqnTxWr4yUObnCFWpMkSuq7yvUXLED/g aDZuyXgom4rg4scfbBGoVz2q2r6zkazPC8sqKR46ChfPp+x2fJ4Lm16Zu7rSOIMcKBj8 80M/RytDJoKnROruKpCfuuNDrFBN4c5i6nV8vKD3HhgXfrrv6en7S/RN3pGDrvqsDYJQ 18+dU0SCOJJD+UhtEuCkDakcJW+5GScVqZUOqG41vshCQa1h7XqtXnNt1Zm+VrpMo20Y E4tmXIN2N1y1G4W9kmZvND256d1P8r7QWbCOt/Zd0PB70kFbahQd7S5FSwYyw9aetrkf UKFA== 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=HUKWoRMcRlPhyTvLxc6NFIJL8o5UDIDnhKkir7q14Yo=; b=a4lQIILhdsV/nlVUCAt4+xwtBI+Ppm2QkWpTujeAKwgGonO2JBs0pLIhnH/hJ17qmb 3kQnSf7GUmXKVyRQe7TIc2nTodT4G6+VhgZ9sZe5kcGeFnVlJB0L3sr1V/FeBps0JcT/ jxWz3rChkVZgiMINhpxUWsQF0HwluyN7O+AVbgLN3toFtbyXXE0DJXWLPBKYllofWYEr DN0NR1uFwW4Hq/f0L/c4++B1RS6/gCoFxq6P4Z0EMGc1ex64Vrbh05rjQyLFO7FLjIgU 8fswzmCpBdNEppWR1ravwoPm+oxgoeLLFc883SLm6S9pKMtfVYvSB/XW2M0lNTkwSWvW HCJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="jopGd//h"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b17-20020a17090636d100b00965e4bf1570si6296969ejc.425.2023.05.29.01.39.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 01:39:50 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="jopGd//h"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 AD612385843E for ; Mon, 29 May 2023 08:34:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD612385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685349297; bh=HUKWoRMcRlPhyTvLxc6NFIJL8o5UDIDnhKkir7q14Yo=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=jopGd//hjs3WGKS+uDVBescZjl4B8Th2wR7EWCjnyDwqRaJx+Ez6L5otU4aQTmZOk u7Kt3gnf0nuZbq2DAcOTa4S+AlMpMZc9vk4Bk4qHVyJhJFSW6zziEuLqwTyhWV1vxh SK2aptT7nATqQ/GPlHn4S3vDMj+BTChGqH8mgVVI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 00C8D385624F for ; Mon, 29 May 2023 08:29:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00C8D385624F Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30ac4e7f37bso1723801f8f.2 for ; Mon, 29 May 2023 01:29:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685348964; x=1687940964; 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=HUKWoRMcRlPhyTvLxc6NFIJL8o5UDIDnhKkir7q14Yo=; b=ZxSDkgYUXTkE86IoS7LRPNvzNd3r/o3Z2E68AGTcM9MpuOnqQAYaCQj2Xi39aKgvZC ObnJcbKcNYJQ3OBI8NaLH5SeBj1Q6mkCnwu/AXuPlltO6vXomKQGpWsuGe6JKuFDK72f eX3dXPBXfeTPBqXP14uf+580DAF/B2wVtO2K6SYip8+X+oBdXbOUU4l1OwDAJ+JZwASL U18vCxpPgn9eVfQqZntM+iWDRmtrkVkOa1KRzzs59eUkxrzb7aDGoPBgqSp+vjENm9LJ ZJH07rFSqEtxL/y/cogl5uQzcsL2e5CdQQv10LZiJWN22CRTbpg8PLs4xnj96ZvbSBu6 Rqdw== X-Gm-Message-State: AC+VfDzYi0y/5PtxxXmzHlsELo79a08JwW6JVGRbwWJBo2Z1Xxk+9Cyq VuOKlA53HVFBh6WHLx3cU8Db3+AIK3UTT/oyUAGkkg== X-Received: by 2002:a5d:640c:0:b0:30a:a478:f559 with SMTP id z12-20020a5d640c000000b0030aa478f559mr9098318wru.2.1685348964864; Mon, 29 May 2023 01:29:24 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id e12-20020a5d65cc000000b0030af05fce4dsm686521wrw.77.2023.05.29.01.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 01:29:24 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Accept parameters of enclosing subprograms in exceptional cases Date: Mon, 29 May 2023 10:29:23 +0200 Message-Id: <20230529082923.2410140-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 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, T_SCC_BODY_TEXT_LINE 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?1767217132160020640?= X-GMAIL-MSGID: =?utf-8?q?1767217132160020640?= From: Piotr Trojanek Rules about parameters of modes OUT and IN OUT in aspect Exceptional_Cases only apply to the parameters of the current subprogram. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Refine rules for Exceptional_Cases. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 6d4bef8d38e..066072a6afe 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -8122,6 +8122,7 @@ package body Sem_Res is -- data from the object. if Ekind (E) in E_Out_Parameter | E_In_Out_Parameter + and then Scope (E) = Current_Scope and then Within_Exceptional_Cases_Consequence (N) and then not In_Attribute_Old (N) and then not (Nkind (Parent (N)) = N_Attribute_Reference