Commit bfda9ccd by Arnaud Charlet

Code clean ups.

From-SVN: r247158
parent ded462b0
...@@ -2025,12 +2025,33 @@ package body Contracts is ...@@ -2025,12 +2025,33 @@ package body Contracts is
return False; return False;
-- Determine whether the subprogram is declared in the visible -- Determine whether the subprogram is declared in the visible
-- declarations of the package containing the type. -- declarations of the package containing the type, or in the
-- visible declaration of a child unit of that package.
else else
return List_Containing (Subp_Decl) = declare
Visible_Declarations Decls : constant List_Id :=
(Specification (Unit_Declaration_Node (Scope (Typ)))); List_Containing (Subp_Decl);
Subp_Scope : constant Entity_Id :=
Scope (Defining_Entity (Subp_Decl));
Typ_Scope : constant Entity_Id := Scope (Typ);
begin
return
Decls = Visible_Declarations
(Specification (Unit_Declaration_Node (Typ_Scope)))
or else
(Ekind (Subp_Scope) = E_Package
and then Typ_Scope /= Subp_Scope
and then Is_Child_Unit (Subp_Scope)
and then
Is_Ancestor_Package (Typ_Scope, Subp_Scope)
and then
Decls = Visible_Declarations
(Specification
(Unit_Declaration_Node (Subp_Scope))));
end;
end if; end if;
end Has_Public_Visibility_Of_Subprogram; end Has_Public_Visibility_Of_Subprogram;
......
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