Commit 81ffc744 by Bob Duff Committed by Pierre-Marie de Rodat

[Ada] T'Size in pragma Compile_Time_Error

2019-10-10  Bob Duff  <duff@adacore.com>

gcc/ada/

	* sem_prag.adb (Defer_Compile_Time_Warning_Error_To_BE): In
	addition to saving the pragma for further processing, copy the
	pragma into the main unit if necessary.

From-SVN: r276819
parent 08f66419
2019-10-10 Bob Duff <duff@adacore.com> 2019-10-10 Bob Duff <duff@adacore.com>
* einfo.ads, einfo.adb (Invariants_Ignored): New flag on types. * sem_prag.adb (Defer_Compile_Time_Warning_Error_To_BE): In
This leaves just one unused flag. addition to saving the pragma for further processing, copy the
* sem_prag.adb (Invariant): Set the flag if appropriate. pragma into the main unit if necessary.
* exp_util.adb (Make_Invariant_Call): Check the flag. \ No newline at end of file
\ No newline at end of file
...@@ -32197,6 +32197,15 @@ package body Sem_Prag is ...@@ -32197,6 +32197,15 @@ package body Sem_Prag is
(New_Val => CTWE_Entry'(Eloc => Sloc (Arg1), (New_Val => CTWE_Entry'(Eloc => Sloc (Arg1),
Scope => Current_Scope, Scope => Current_Scope,
Prag => N)); Prag => N));
-- If the Boolean expression contains T'Size, and we're not in the main
-- unit being compiled, then we need to copy the pragma into the main
-- unit, because otherwise T'Size might never be computed, leaving it
-- as 0.
if not In_Extended_Main_Code_Unit (N) then
Insert_Library_Level_Action (New_Copy_Tree (N));
end if;
end Defer_Compile_Time_Warning_Error_To_BE; end Defer_Compile_Time_Warning_Error_To_BE;
------------------------------------------ ------------------------------------------
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