aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/einfo.adb
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2020-08-25 15:08:22 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-22 08:11:27 -0400
commitb2dea70e920c5dab3118f362f693d4c0e6d9af87 (patch)
tree3ad25c33fd88b935e65989ed1119da895b503417 /gcc/ada/einfo.adb
parentf0c57fcd0a50c9f96ee108c9299eed22e639f354 (diff)
downloadgcc-b2dea70e920c5dab3118f362f693d4c0e6d9af87.zip
gcc-b2dea70e920c5dab3118f362f693d4c0e6d9af87.tar.gz
gcc-b2dea70e920c5dab3118f362f693d4c0e6d9af87.tar.bz2
[Ada] ACATS 4.1H - B853001 - missed errors for renamed limited
gcc/ada/ * einfo.ads (Has_Limited_View): New synthesized attribute. * einfo.adb (Has_Limited_View): New synthesized attribute. (Set_Limited_View): Complete assertion. * sem_ch10.ads (Is_Visible_Through_Renamings): Make this routine public to invoke it from Find_Expanded_Name and avoid reporting spurious errors on renamings of limited-with packages. (Load_Needed_Body): Moved to have this spec alphabetically ordered. * sem_ch10.adb (Is_Visible_Through_Renamings): Moved to library level. (Is_Limited_Withed_Unit): New subprogram. * sem_ch3.adb (Access_Type_Declaration): Adding protection to avoid reading attribute Entity() when not available. * sem_ch8.adb (Analyze_Package_Renaming): Report error on renamed package not visible through context clauses. (Find_Expanded_Name): Report error on renamed package not visible through context clauses; handle special case where the prefix is a renaming of a (now visible) shadow package.
Diffstat (limited to 'gcc/ada/einfo.adb')
-rw-r--r--gcc/ada/einfo.adb14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index d4a4310e..0c88c88 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -6071,7 +6071,8 @@ package body Einfo is
procedure Set_Limited_View (Id : E; V : E) is
begin
- pragma Assert (Ekind (Id) = E_Package);
+ pragma Assert (Ekind (Id) = E_Package
+ and then not Is_Generic_Instance (Id));
Set_Node23 (Id, V);
end Set_Limited_View;
@@ -7847,6 +7848,17 @@ package body Einfo is
end Has_Invariants;
--------------------------
+ -- Has_Limited_View --
+ --------------------------
+
+ function Has_Limited_View (Id : E) return B is
+ begin
+ return Ekind (Id) = E_Package
+ and then not Is_Generic_Instance (Id)
+ and then Present (Limited_View (Id));
+ end Has_Limited_View;
+
+ --------------------------
-- Has_Non_Limited_View --
--------------------------