Commit c223b764 by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Spurious visibility error in predicate in generic instance

2019-10-10  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_cat.adb (Set_Categorization_From_Pragma): Do not modify
	any visibility settings if there are no compilation_unit pragmas
	following the package declaration. Add comments for future
	cleanup.

From-SVN: r276812
parent 92219bab
2019-10-10 Patrick Bernardi <bernardi@adacore.com>
2019-10-10 Ed Schonberg <schonberg@adacore.com>
* bindgen.adb (System_Secondary_Stack_Package_In_Closure):
Renamed flag System_Secondary_Stack_Used to be clearer of what
it represents.
(Gen_Adainit): Refactor secondary stack related code to make it
clearer.
* rtsfind.adb (Load_RTU): Don't set Sec_Stack_Used flag here
(RTE): Set Sec_Stack_Used if the System.Secondary_Stack is
referenced, but not if we're ignoring ghost code.
\ No newline at end of file
* sem_cat.adb (Set_Categorization_From_Pragma): Do not modify
any visibility settings if there are no compilation_unit pragmas
following the package declaration. Add comments for future
cleanup.
\ No newline at end of file
......@@ -721,9 +721,15 @@ package body Sem_Cat is
-- The purpose is to set categorization flags before analyzing the
-- unit itself, so as to diagnose violations of categorization as
-- we process each declaration, even though the pragma appears after
-- the unit.
if Nkind (P) /= N_Compilation_Unit then
-- the unit. This processing is only needsd if compilation unit
-- pragmas are present.
-- Note: this code may be incorrect in the unlikely case a child
-- genericc unit is instantiated as a child of its (non-generic)
-- parent, so that generic and insstance are siblings,
if Nkind (P) /= N_Compilation_Unit
or else No (First (Pragmas_After (Aux_Decls_Node (P))))
then
return;
end if;
......
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