gcc/ada/
* sem_res.adb (Resolve_Declare_Expression): Retrieve the created
block entity that is the scope of the local declarations, from
either a local object declaration or an object renaming
declaration. The block entity does not have an explicit
declaration, but appears as the scope of all locally declared
objects.
-- Install the scope created for local declarations, if
-- any. The syntax allows a Declare_Expression with no
-- declarations, in analogy with block statements.
+ -- Note that that scope has no explicit declaration, but
+ -- appears as the scope of all entities declared therein.
Decl := First (Actions (N));
while Present (Decl) loop
- exit when Nkind (Decl) = N_Object_Declaration;
+ exit when Nkind (Decl)
+ in N_Object_Declaration | N_Object_Renaming_Declaration;
Next (Decl);
end loop;