From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 805883857725; Tue, 20 Jun 2023 07:47:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 805883857725 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687247222; bh=kycTdn0rhwVTc5jKr7gLSGi8RmcPAPe7sB2O3Gqj5fI=; h=From:To:Subject:Date:From; b=oBQRINJfPt0QZsS/Vec5YxQBPbaxBcrREVxEl1FHV1kCUU8XFlrLZIhP/MfBvbK/o bed1wlikLhnku0IjUWGgYlDi0jRH9RyYc4uLnr42zmIq1cQSaJ1T19+jfqjDUq4swZ oBoumCzT0xc/ezjmDnWbs1Q9i4Q5wlTWBcZlP33s= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1975] ada: Fix for attribute Range in Exceptional_Cases X-Act-Checkin: gcc X-Git-Author: Piotr Trojanek X-Git-Refname: refs/heads/master X-Git-Oldrev: 0aca9f500e7e8f4b6c84f25a25289b2d4d4ca95f X-Git-Newrev: b367a66cfb620b88338111eebd549cc2fad1c16b Message-Id: <20230620074702.805883857725@sourceware.org> Date: Tue, 20 Jun 2023 07:47:02 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b367a66cfb620b88338111eebd549cc2fad1c16b commit r14-1975-gb367a66cfb620b88338111eebd549cc2fad1c16b Author: Piotr Trojanek Date: Mon Jun 5 10:30:39 2023 +0200 ada: Fix for attribute Range in Exceptional_Cases Attribute Range is now handled like First and Last when occurring within the consequence of Exceptional_Cases, i.e. attribute Range is not considered to be a read of a formal parameter that would not be allowed in the contract. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Handle Range like First and Last. Diff: --- gcc/ada/sem_res.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 6867c8f1275..ef3b877f5db 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -8124,7 +8124,8 @@ package body Sem_Res is Attribute_Name (Parent (N)) in Name_Constrained | Name_First | Name_Last - | Name_Length) + | Name_Length + | Name_Range) and then not Is_By_Reference_Type (Etype (E)) and then not Is_Aliased (E) then