]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add missing dimension information for target names
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 11 Jun 2024 17:29:22 +0000 (19:29 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 27 Jun 2024 08:19:12 +0000 (10:19 +0200)
It is computed from the Etype of N_Target_Name nodes.

gcc/ada/

* sem_ch5.adb (Analyze_Target_Name): Call Analyze_Dimension on the
node once the Etype is set.
* sem_dim.adb (OK_For_Dimension): Set to True for N_Target_Name.
(Analyze_Dimension): Call Analyze_Dimension_Has_Etype for it.

gcc/ada/sem_ch5.adb
gcc/ada/sem_dim.adb

index b92ceb17b1baa619579743159baed4785cf1b6b9..644bd21ce93d72d2968c9ded18fb6d4bc49468b5 100644 (file)
@@ -4201,6 +4201,7 @@ package body Sem_Ch5 is
                if Current = Expression (Context) then
                   pragma Assert (Context = Current_Assignment);
                   Set_Etype (N, Etype (Name (Current_Assignment)));
+                  Analyze_Dimension (N);
                else
                   Report_Error;
                end if;
index 45a0f2ab922eaca6f05d5b82af22cc11a5a572cd..39c3633249796c61285734d3371e683996a56dc1 100644 (file)
@@ -219,6 +219,7 @@ package body Sem_Dim is
       N_Real_Literal              => True,
       N_Selected_Component        => True,
       N_Slice                     => True,
+      N_Target_Name               => True,
       N_Type_Conversion           => True,
       N_Unchecked_Type_Conversion => True,
 
@@ -1179,6 +1180,7 @@ package body Sem_Dim is
             | N_Qualified_Expression
             | N_Selected_Component
             | N_Slice
+            | N_Target_Name
             | N_Unchecked_Type_Conversion
          =>
             Analyze_Dimension_Has_Etype (N);