diff options
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index b73b947..96e8da6 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -757,14 +757,6 @@ package body Sem_Res is goto No_Danger; end if; - -- If the enclosing type is limited, we allocate only the - -- default value, not the maximum, and there is no need for - -- a warning. - - if Is_Limited_Type (Scope (Disc)) then - goto No_Danger; - end if; - -- Check that it is the high bound if N /= High_Bound (PN) @@ -811,11 +803,9 @@ package body Sem_Res is goto No_Danger; end if; - -- Warn about the danger - - Error_Msg_N - ("??creation of & object may raise Storage_Error!", - Scope (Disc)); + if Ekind (Scope (Disc)) = E_Record_Type then + Set_Is_Large_Unconstrained_Definite (Scope (Disc)); + end if; <<No_Danger>> null; @@ -2106,8 +2096,6 @@ package body Sem_Res is Full_Analysis := False; Expander_Mode_Save_And_Set (False); - -- See also Preanalyze_And_Resolve in sem.adb for similar handling - -- Normally, we suppress all checks for this preanalysis. There is no -- point in processing them now, since they will be applied properly -- and in the proper location when the default expressions reanalyzed @@ -2150,8 +2138,13 @@ package body Sem_Res is Full_Analysis := False; Expander_Mode_Save_And_Set (False); - Analyze (N); - Resolve (N, Etype (N), Suppress => All_Checks); + -- See previous version of Preanalyze_And_Resolve for similar handling + + if GNATprove_Mode then + Analyze_And_Resolve (N); + else + Analyze_And_Resolve (N, Suppress => All_Checks); + end if; Expander_Mode_Restore; Full_Analysis := Save_Full_Analysis; @@ -4849,6 +4842,7 @@ package body Sem_Res is if not Is_OK_Variable_For_Out_Formal (A) and then not Is_Init_Proc (Nam) + and then not Is_Expanded_Constructor_Call (N) then Error_Msg_NE ("actual for& must be a variable", A, F); @@ -6101,6 +6095,8 @@ package body Sem_Res is elsif Is_Fixed_Point_Type (It.Typ) then if Analyzed (N) then Error_Msg_N ("ambiguous operand in fixed operation", N); + elsif It.Typ = Any_Fixed then + Resolve (N, B_Typ); else Resolve (N, It.Typ); end if; @@ -7801,6 +7797,7 @@ package body Sem_Res is then Set_Entity (N, Local); Set_Etype (N, Etype (Local)); + Generate_Reference (Local, N); end if; return OK; @@ -8150,6 +8147,7 @@ package body Sem_Res is and then not Preanalysis_Active and then not Is_Imported (E) and then Nkind (Parent (E)) /= N_Object_Renaming_Declaration + and then not Needs_Construction (Etype (E)) then if No_Initialization (Parent (E)) or else (Present (Full_View (E)) |