diff options
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 5768e28e..c9b9e7f 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -276,6 +276,7 @@ package body Sem_Ch12 is -- Pre -- Pre_Class -- Precondition + -- Program_Exit -- Refined_Depends -- Refined_Global -- Refined_Post @@ -3371,7 +3372,7 @@ package body Sem_Ch12 is end if; if Present (E) then - Preanalyze_Spec_Expression (E, T); + Preanalyze_And_Resolve_Spec_Expression (E, T); -- The default for a ghost generic formal IN parameter of -- access-to-variable type should be a ghost object (SPARK @@ -4195,7 +4196,7 @@ package body Sem_Ch12 is elsif Present (Expr) then Push_Scope (Nam); Install_Formals (Nam); - Preanalyze_Spec_Expression (Expr, Etype (Nam)); + Preanalyze_And_Resolve_Spec_Expression (Expr, Etype (Nam)); End_Scope; end if; @@ -13034,10 +13035,6 @@ package body Sem_Ch12 is Make_Defining_Identifier (Sloc (Act_Decl_Id), Chars (Act_Decl_Id)); Preserve_Comes_From_Source (Act_Body_Id, Act_Decl_Id); - -- Some attributes of spec entity are not inherited by body entity - - Set_Handler_Records (Act_Body_Id, No_List); - if Nkind (Defining_Unit_Name (Act_Spec)) = N_Defining_Program_Unit_Name then @@ -14132,6 +14129,16 @@ package body Sem_Ch12 is T2 := Etype (I2); end if; + -- In the case of a fixed-lower-bound subtype, we want to check + -- against the index type's range rather than the range of the + -- subtype (which will be seen as unconstrained, and whose bounds + -- won't generally match those of the formal unconstrained array + -- type's corresponding index type). + + if Is_Fixed_Lower_Bound_Index_Subtype (T2) then + T2 := Etype (Scalar_Range (T2)); + end if; + if not Subtypes_Match (Find_Actual_Type (Etype (I1), A_Gen_T), T2) then |