]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Spurious visibility on private with package
authorArnaud Charlet <charlet@adacore.com>
Tue, 23 Jun 2020 14:39:12 +0000 (10:39 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 15 Oct 2020 09:39:14 +0000 (05:39 -0400)
gcc/ada/

* sem_ch10.adb (Install_With_Clause): Fix implementation of Ada
2005 AI-262 by taking into account generic packages.  Minor
reformatting.
* libgnat/a-cbhase.ads, libgnat/a-cbhase.adb: Remove use clause
on runtime unit spec.

gcc/ada/libgnat/a-cbhase.adb
gcc/ada/libgnat/a-cbhase.ads
gcc/ada/sem_ch10.adb

index a332bd74a7fd6657a245f336f685016642082660..09505535e5eeee784689e155b4a523f28581ff52 100644 (file)
@@ -42,6 +42,7 @@ with System; use type System.Address;
 package body Ada.Containers.Bounded_Hashed_Sets with
   SPARK_Mode => Off
 is
+   use Ada.Finalization;
 
    pragma Warnings (Off, "variable ""Busy*"" is not referenced");
    pragma Warnings (Off, "variable ""Lock*"" is not referenced");
index 32e9d927e1cb7575b3b5bfd24875869ce4e387cf..2d8a7ee56f68e1eee2068d9d4cf8f2c9466cff79 100644 (file)
@@ -36,7 +36,7 @@ with Ada.Iterator_Interfaces;
 private with Ada.Containers.Hash_Tables;
 with Ada.Containers.Helpers;
 private with Ada.Streams;
-private with Ada.Finalization; use Ada.Finalization;
+private with Ada.Finalization;
 
 generic
    type Element_Type is private;
@@ -592,7 +592,7 @@ private
 
    No_Element : constant Cursor := (Container => null, Node => 0);
 
-   type Iterator is new Limited_Controlled and
+   type Iterator is new Ada.Finalization.Limited_Controlled and
      Set_Iterator_Interfaces.Forward_Iterator with
    record
       Container : Set_Access;
index 76b68a190c046960c156813dc6c2b960e408d84f..9749fd4b6f71b11d6a173290eec39eabe45b0cdb 100644 (file)
@@ -5303,8 +5303,9 @@ package body Sem_Ch10 is
       --  analyzing the private part of the package).
 
       if Private_Present (With_Clause)
-        and then Nkind (Unit (Parent (With_Clause))) = N_Package_Declaration
-        and then not (Private_With_OK)
+        and then Nkind (Unit (Parent (With_Clause)))
+                   in N_Package_Declaration | N_Generic_Package_Declaration
+        and then not Private_With_OK
       then
          return;
       end if;
@@ -5371,7 +5372,7 @@ package body Sem_Ch10 is
             Set_Is_Visible_Lib_Unit (Uname);
 
             --  If the unit is a wrapper package for a compilation unit that is
-            --  a subprogrm instance, indicate that the instance itself is a
+            --  a subprogram instance, indicate that the instance itself is a
             --  visible unit. This is necessary if the instance is inlined.
 
             if Is_Wrapper_Package (Uname) then
@@ -6464,7 +6465,7 @@ package body Sem_Ch10 is
             null;
 
          elsif Nkind (Item) = N_With_Clause
-            and then Context_Installed (Item)
+           and then Context_Installed (Item)
          then
             --  Remove items from one with'ed unit
 
@@ -6818,12 +6819,12 @@ package body Sem_Ch10 is
       -- In_Regular_With_Clause --
       ----------------------------
 
-      function In_Regular_With_Clause (E : Entity_Id) return Boolean
-      is
+      function In_Regular_With_Clause (E : Entity_Id) return Boolean is
          Item : Node_Id;
 
       begin
          Item := First (Context_Items (Comp_Unit));
+
          while Present (Item) loop
             if Nkind (Item) = N_With_Clause
 
@@ -6836,6 +6837,7 @@ package body Sem_Ch10 is
             then
                return True;
             end if;
+
             Next (Item);
          end loop;
 
This page took 0.085858 seconds and 5 git commands to generate.