diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -5978,7 +5978,7 @@ package body Sem_Ch3 is if Nkind (Subtype_Indication (N)) = N_Subtype_Indication then declare Indic_Typ : constant Entity_Id := - Etype (Subtype_Mark (Subtype_Indication (N))); + Underlying_Type (Etype (Subtype_Mark (Subtype_Indication (N)))); Subt_Index : Node_Id; Target_Index : Node_Id; @@ -13595,6 +13595,8 @@ package body Sem_Ch3 is T := Designated_Type (T); end if; + T := Underlying_Type (T); + -- If an index constraint follows a subtype mark in a subtype indication -- then the type or subtype denoted by the subtype mark must not already -- impose an index constraint. The subtype mark must denote either an