]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix for attribute Range in Exceptional_Cases
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 5 Jun 2023 08:30:39 +0000 (10:30 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 20 Jun 2023 07:30:50 +0000 (09:30 +0200)
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.

gcc/ada/sem_res.adb

index 6867c8f1275e449cbec60bc82614e3e165a4e570..ef3b877f5db432b6e8b56561d4a4fdeced33e2c3 100644 (file)
@@ -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