@@ -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;
@@ -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);
From: Eric Botcazou <ebotcazou@adacore.com> 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. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 1 + gcc/ada/sem_dim.adb | 2 ++ 2 files changed, 3 insertions(+)