Commit ee7c8ffd by Robert Dewar Committed by Arnaud Charlet

errout.adb (Error_Msg_Internal): For non-serious error set Fatal_Error to Ignored.

2015-02-05  Robert Dewar  <dewar@adacore.com>

	* 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
parent 4ed8ef26
2015-02-05 Robert Dewar <dewar@adacore.com>
* 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 <moy@adacore.com> 2015-02-05 Yannick Moy <moy@adacore.com>
* sem_prag.adb, par-prag.adb: Minor code clean up. * sem_prag.adb, par-prag.adb: Minor code clean up.
......
...@@ -1164,6 +1164,17 @@ package body Errout is ...@@ -1164,6 +1164,17 @@ package body Errout is
if Errors.Table (Cur_Msg).Serious then if Errors.Table (Cur_Msg).Serious then
Serious_Errors_Detected := Serious_Errors_Detected + 1; Serious_Errors_Detected := Serious_Errors_Detected + 1;
Handle_Serious_Error; 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;
end if; end if;
......
...@@ -740,16 +740,24 @@ package body Lib.Load is ...@@ -740,16 +740,24 @@ package body Lib.Load is
goto Done; goto Done;
end if; 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 if Present (Error_Node) then
case Units.Table (Unum).Fatal_Error is case Units.Table (Unum).Fatal_Error is
-- Nothing to do if with'ed unit had no error
when None => when None =>
null; null;
-- If with'ed unit had a detected fatal error, propagate it
when Error_Detected => when Error_Detected =>
Units.Table (Calling_Unit).Fatal_Error := 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 => when Error_Ignored =>
if Units.Table (Calling_Unit).Fatal_Error = None then if Units.Table (Calling_Unit).Fatal_Error = None then
Units.Table (Calling_Unit).Fatal_Error := Units.Table (Calling_Unit).Fatal_Error :=
......
...@@ -2821,6 +2821,29 @@ package body Sem_Ch10 is ...@@ -2821,6 +2821,29 @@ package body Sem_Ch10 is
if Private_Present (N) then if Private_Present (N) then
Set_Is_Immediately_Visible (E_Name, False); Set_Is_Immediately_Visible (E_Name, False);
end if; 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; end Analyze_With_Clause;
------------------------------ ------------------------------
......
...@@ -21340,6 +21340,11 @@ package body Sem_Prag is ...@@ -21340,6 +21340,11 @@ package body Sem_Prag is
-- always considered to be a tool name, even if there is a string -- always considered to be a tool name, even if there is a string
-- variable of that name. -- 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 when Pragma_Warnings => Warnings : declare
Reason : String_Id; Reason : String_Id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment