This further adjusts a test deciding whether to freeze an entity coming from
an outer scope in an inner scope based on language rules, to the presence of
the new internal subprogram generated because of post-conditions.
gcc/ada/
* freeze.adb (Freeze_Entity): For the purpose of deciding whether to
freeze an entity coming from an outer scope in an inner scope, treat
the internal subprogram generated because of post-conditions as also
coming from source if the original subprogram itself does.
end if;
-- Otherwise, loop through scopes checking if an enclosing scope
- -- comes from source or is a generic.
+ -- comes from source or is a generic. Note that, for the purpose
+ -- of this test, we need to consider that the internally generated
+ -- subprogram described above comes from source too if the original
+ -- subprogram itself does.
declare
S : Entity_Id;
while Present (S) loop
if Is_Overloadable (S) then
if Comes_From_Source (S)
+ or else (Chars (S) = Name_uWrapped_Statements
+ and then Comes_From_Source (Scope (S)))
or else Is_Generic_Instance (S)
or else Is_Child_Unit (S)
then