From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id A59C53856DC0 for ; Mon, 26 Sep 2022 09:15:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A59C53856DC0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32b.google.com with SMTP id n40-20020a05600c3ba800b003b49aefc35fso3342430wms.5 for ; Mon, 26 Sep 2022 02:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=fZTjOTdN4t7QPpnOWeMYobS5Dwa+5488hJOAC/ZmKsg=; b=fSj2ERSSxqxa3XLSnTz7RMVXoCJnfL2MdslwwND5nxMYfB68mtKXU0h5X8Dm6gZIYC u8iO45l4JOoT8Q9Wj1gxuRkRJFhc6em/he+2ua6sXBjysVA5ikIDSJlGrcmk1tZi1e3E XRw2EM9ugeglU2tyTppEaU4r1MHA9/BqnO0u46MX0p1EU6bRDLMFVbz2ql6ByRItUqFS 4whBfg5eakY4NSshnGE/LPfmR+D+xUXy6Wsc0vynKS4raMTXGeJpYbTiwSlr1obgua0F JCQTrrQYbOo2h0djIkYq0dDRpSgp3uTh7NlFKhKV1jSN7ak2kdMrHmPiP9HU6TJQP9cR loSQ== 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; bh=fZTjOTdN4t7QPpnOWeMYobS5Dwa+5488hJOAC/ZmKsg=; b=yCHYOLy7rPM9TEcJwsSdQpWuHAYvGYQ74r/EHO5d4P71jdkJNB55lt5hV9LaIdKHxS S2Eeiq/g1uVA+bSUI2teESK1JfyarN+wfAYeXKDZOaB6H56+0vjjevL8AcYbAEAQ/iQl 5beW1Ld00NBCe8HqBKhWsCJ1FPjGHNZC1c0/KRQKrSs0D/SQg5Cjh4uGfhV/JDsqBGZf TniwewPlGYftRpiVdT7ZE11Oaltv6QobEBrmL8m0pT6dp6Lk+OIMLJMVfjL0bvcS8k3i 10tPKW1z2IiIUgMYkRc9OaY1Xl4sHgFN3lJ4kHYmAAbCdjmEsT8XjBlbYd4GTxWsVxx0 fGPg== X-Gm-Message-State: ACrzQf2NbEwG+0nz6wJo3zifZZ8Mg0cZLb9MbmDqoIH0iCPAo0ky01pu AgQqilsFlt0nSudfCw1rZQ/h9GTFNBolrg== X-Google-Smtp-Source: AMsMyM58G9V4aRi6LBa2y6YurQFYhEwDxrvKtnEibpV/zV4wMKOmSl+iw1Dh7YnRWLSRY/V6xIkwGw== X-Received: by 2002:a7b:c7d8:0:b0:3b4:5c41:6a6c with SMTP id z24-20020a7bc7d8000000b003b45c416a6cmr13878912wmk.139.1664183702452; Mon, 26 Sep 2022 02:15:02 -0700 (PDT) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id i14-20020a5d558e000000b00224f7c1328dsm13657084wrv.67.2022.09.26.02.15.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 02:15:02 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITED] ada: Delay expansion of iterated component association Date: Mon, 26 Sep 2022 11:14:58 +0200 Message-Id: <20220926091458.273107-1-poulhies@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.1 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 List-Id: From: Piotr Trojanek When preanalysing spec expression (e.g. expression of an expression function), the name of iterator specification within an iterated component association should not be expanded, especially in GNATprove mode. gcc/ada/ * sem_ch5.adb (Analyze_Iterator_Specification): Delay expansion of for iterated component association just like it is done within quantified expression. --- gcc/ada/sem_ch5.adb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 17bf6d91b44..6d07f3d09e5 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2429,11 +2429,12 @@ package body Sem_Ch5 is if not Is_Entity_Name (Iter_Name) - -- When the context is a quantified expression, the renaming - -- declaration is delayed until the expansion phase if we are - -- doing expansion. + -- When the context is a quantified expression or iterated component + -- association, the renaming declaration is delayed until the + -- expansion phase if we are doing expansion. - and then (Nkind (Parent (N)) /= N_Quantified_Expression + and then (Nkind (Parent (N)) not in N_Quantified_Expression + | N_Iterated_Component_Association or else (Operating_Mode = Check_Semantics and then not GNATprove_Mode)) -- 2.25.1