From: Robert Dewar Date: Thu, 5 Feb 2015 14:31:10 +0000 (+0000) Subject: errout.adb (Error_Msg_Internal): For non-serious error set Fatal_Error to Ignored. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee7c8ffd33b0919d52b413c4eb816062f2e8cbc5;p=gcc.git errout.adb (Error_Msg_Internal): For non-serious error set Fatal_Error to Ignored. 2015-02-05 Robert Dewar * errout.adb (Error_Msg_Internal): For non-serious error set Fatal_Error to Ignored. * lib-load.adb (Load_Unit): Minor comment updates. * sem_ch10.adb (Analyze_With_Clause): Propagate Fatal_Error setting from with'ed unit to with'ing unit. * sem_prag.adb (Analyze_Pragma, case Warnings): Document handling of ambiguity. From-SVN: r220450 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 69fa5f6eaab..6da97c7b27c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2015-02-05 Robert Dewar + + * errout.adb (Error_Msg_Internal): For non-serious error set + Fatal_Error to Ignored. + * lib-load.adb (Load_Unit): Minor comment updates. + * sem_ch10.adb (Analyze_With_Clause): Propagate Fatal_Error + setting from with'ed unit to with'ing unit. + * sem_prag.adb (Analyze_Pragma, case Warnings): Document handling + of ambiguity. + 2015-02-05 Yannick Moy * sem_prag.adb, par-prag.adb: Minor code clean up. diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index df0fa96387d..86ea13f6fbb 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -1164,6 +1164,17 @@ package body Errout is if Errors.Table (Cur_Msg).Serious then Serious_Errors_Detected := Serious_Errors_Detected + 1; Handle_Serious_Error; + + -- If not serious error, set Fatal_Error to indicate ignored error + + else + declare + U : constant Unit_Number_Type := Get_Source_Unit (Sptr); + begin + if Fatal_Error (U) = None then + Set_Fatal_Error (U, Error_Ignored); + end if; + end; end if; end if; diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb index fc52f84f4ef..aef313f979b 100644 --- a/gcc/ada/lib-load.adb +++ b/gcc/ada/lib-load.adb @@ -740,16 +740,24 @@ package body Lib.Load is goto Done; end if; - -- If loaded unit had a fatal error, then caller inherits it + -- If loaded unit had a fatal error, then caller inherits setting if Present (Error_Node) then case Units.Table (Unum).Fatal_Error is + + -- Nothing to do if with'ed unit had no error + when None => null; + -- If with'ed unit had a detected fatal error, propagate it + when Error_Detected => Units.Table (Calling_Unit).Fatal_Error := Error_Detected; + -- If with'ed unit had an ignored error, then propagate it + -- but do not overide an existring setting. + when Error_Ignored => if Units.Table (Calling_Unit).Fatal_Error = None then Units.Table (Calling_Unit).Fatal_Error := diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index d7df7eb9bbb..31542fe3025 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -2821,6 +2821,29 @@ package body Sem_Ch10 is if Private_Present (N) then Set_Is_Immediately_Visible (E_Name, False); end if; + + -- Propagate Fatal_Error setting from with'ed unit to current unit + + case Fatal_Error (Get_Source_Unit (Library_Unit (N))) is + + -- Nothing to do if with'ed unit had no error + + when None => + null; + + -- If with'ed unit had a detected fatal error, propagate it + + when Error_Detected => + Set_Fatal_Error (Current_Sem_Unit, Error_Detected); + + -- If with'ed unit had an ignored error, then propagate it + -- but do not overide an existring setting. + + when Error_Ignored => + if Fatal_Error (Current_Sem_Unit) = None then + Set_Fatal_Error (Current_Sem_Unit, Error_Ignored); + end if; + end case; end Analyze_With_Clause; ------------------------------ diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 232d53de8cc..01fe51e263c 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -21340,6 +21340,11 @@ package body Sem_Prag is -- always considered to be a tool name, even if there is a string -- variable of that name. + -- Note if the second argument of DETAILS is a local_NAME then the + -- second form is always understood. If the intention is to use + -- the fourth form, then you can write NAME & "" to force the + -- intepretation as a static_string_EXPRESSION. + when Pragma_Warnings => Warnings : declare Reason : String_Id;