Skip to content
Snippets Groups Projects
Commit cb690aa1 authored by Marc Poulhiès's avatar Marc Poulhiès Committed by Marc Poulhiès
Browse files

ada: Also reset scope for some nested declaration

When changing the scope for entities found in the entry body that is
mutated into a procedure, the compiler needs to look deeper than only
the top level entities as expansion may produce object declarations
which scopes are also the entry. For example, the tree after expansion
may look like:

  procedure This_Is_An_Entry_Proc is
     ...
     O1 : Typ := do
       TMP1 : OTyp := ...;
       ...
     in TMP1;

O1's scope needs to be reset to This_Is_An_Entry_Proc, but so does
TMP1's scope.

This change also fix a small oversight where
N_Implicit_Label_Declaration scope must be reset and its content
skipped.

gcc/ada/

	* exp_ch9.adb (Reset_Scopes_To): Adjust comment.
	(Reset_Scopes_To.Reset_Scope): Adjust the scope reset for object
	declaration. In particular, visit the children nodes if any. Also
	extend the handling of other declarations to
	N_Implicit_Label_Declaration.
parent 905ab329
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment