ada: Fix memory leak for unconstrained limited arrays in anonymous contexts
A change made a long time ago has introduced a leak of the secondary stack
at run time for unconstrained limited non-controlled arrays in anonymous
contexts, because of the lack of a transient scope in these contexts.
The large comment preceding the call to Establish_Transient_Scope in the
Resolve_Call procedure explains the strategy for build-in-place functions,
so the best course of action is probably to revert the commit and to fix
the original problem along the lines of the comment.
gcc/ada/ChangeLog:
* exp_ch3.adb (Expand_N_Object_Declaration): Delete ancient comment.
* exp_ch6.adb (Expand_Call_Helper): Do not establish a transient
scope for build-in-place functions in anonymous contexts here...
(Make_Build_In_Place_Call_In_Anonymous_Context): ...but here instead.
* sem_attr.adb (Resolve_Attribute) <Attribute_Range>: Remove obsolete
code dealing with transient scopes.
* sem_res.adb (Resolve_Actuals): Likewise.
(Resolve_Call): Adjust comment on the strategy for transient scopes.