]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Handle accessibility calculations for 'First and 'Last
authorJustin Squirek <squirek@adacore.com>
Wed, 27 Mar 2024 01:02:41 +0000 (01:02 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 20 May 2024 07:47:05 +0000 (09:47 +0200)
This patch fixes a crash in the compiler whereby calculating the accessibility
level of of a local variable whose original expression is an 'First on an
array type led to an error during compilation.

gcc/ada/

* accessibility.adb (Accessibility_Level): Add cases for 'First
and 'Last.

gcc/ada/accessibility.adb

index c0a9d50f38ab0ef4affdf3bd1b374dd0f8d08ce0..33ce001718a2b1fb162a003f012a5f0ab290d0bc 100644 (file)
@@ -465,7 +465,15 @@ package body Accessibility is
             --  so handle these cases explicitly.
 
             elsif Attribute_Name (E)
-                    in Name_Old | Name_Loop_Entry | Name_Result | Name_Super
+                    in Name_Old        |
+                       Name_Loop_Entry |
+                       Name_Result     |
+                       Name_Super      |
+                       Name_Tag        |
+                       Name_Safe_First |
+                       Name_Safe_Last  |
+                       Name_First      |
+                       Name_Last
             then
                --  Named access types