[Ada] Crash on task declaration with Restriction_Warning (No_Tasking)

gcc/ada/

	* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
	when the restriction is a configuration pragma and specifies
	No_Tasking, a global flag is set to reject task declarations,
	and to prevent the construction of Master entities. The flag
	must not be set if the pragma is a Restriction_Warning, in which
	case task declarationns are allowed.
This commit is contained in:
Ed Schonberg 2020-10-27 09:24:51 -04:00 committed by Pierre-Marie de Rodat
parent 9597d24c7f
commit 52424b13d8

View File

@ -10438,10 +10438,13 @@ package body Sem_Prag is
Add_To_Config_Boolean_Restrictions (No_Elaboration_Code);
end if;
-- Special processing for No_Tasking restriction placed in
-- a configuration pragmas file.
-- Special processing for No_Tasking restriction (not just a
-- warning) when it appears as a configuration pragmas.
elsif R_Id = No_Tasking and then No (Cunit (Main_Unit)) then
elsif R_Id = No_Tasking
and then No (Cunit (Main_Unit))
and then not Warn
then
Set_Global_No_Tasking;
end if;