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

[Ada] Spurious visibility error on subunit with optimization

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

gcc/ada/

	* sem_ch10.adb (Analyze_Subunit): Fix spurious visibility error
	on subunit with optimization.

From-SVN: r279291
parent 4cd30bf7
2019-12-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_Subunit): Fix spurious visibility error
on subunit with optimization.
2019-12-12 Arnaud Charlet <charlet@adacore.com> 2019-12-12 Arnaud Charlet <charlet@adacore.com>
* raise-gcc.c (__gnat_personality_v0): Define for SEH. * raise-gcc.c (__gnat_personality_v0): Define for SEH.
......
...@@ -2226,9 +2226,18 @@ package body Sem_Ch10 is ...@@ -2226,9 +2226,18 @@ package body Sem_Ch10 is
-- If the subunit occurs within a child unit, we must restore the -- If the subunit occurs within a child unit, we must restore the
-- immediate visibility of any siblings that may occur in context. -- immediate visibility of any siblings that may occur in context.
-- In addition, we must reset the previous visibility of the
-- parent unit which is now on the scope stack. This is because
-- the Previous_Visibility was previously set when removing the
-- context. This is necessary to prevent the parent entity from
-- remaining visible after the subunit is compiled. This only
-- has an effect if a homonym exists in a body to be processed
-- later if inlining is enabled.
if Present (Enclosing_Child) then if Present (Enclosing_Child) then
Install_Siblings (Enclosing_Child, L); Install_Siblings (Enclosing_Child, L);
Scope_Stack.Table (Scope_Stack.Last).Previous_Visibility :=
False;
end if; end if;
Push_Scope (Scop); Push_Scope (Scop);
......
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