with Ada.Strings.Unbounded;
with X_Unuse_Pack;

procedure T_Unuse is
   

   -- Various namings
   S1 : Ada.Strings.Unbounded.Unbounded_String;
   S2 : Ada.Strings.Unbounded.Unbounded_String;
   S3 : Ada.Strings.Unbounded.Unbounded_String;

   I1 : aliased X_Unuse_Pack.Pack_Int1;
   I2 : X_Unuse_Pack.Pack_Int2;

   Enum : X_Unuse_Pack.Pack_Enum;

   -- Pragmas and attributes
   type Tab is array (1 .. 10) of Character;
   pragma Pack (Tab);
   for Tab'Size use 80;

   -- Don't apply to entities from Standard
   I_Standard : Integer := 3;
   Direct_Vis : String := Integer'Image (I_Standard);

   package Not_Direct_Vis is
      Internal_S : String := Integer'Image (I_Standard);
   end Not_Direct_Vis;
   

begin
   -- Various usages
   S1 := Ada.Strings.Unbounded.Null_Unbounded_String;
   I_Standard := I_Standard + 2;

   declare
      
      
      D : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
      ND : X_Unuse_Pack.Dispatcher;
   begin
      Direct_Vis (X_Unuse_Pack.Internal.V) := 'a';
      T_Unuse.Direct_Vis (X_Unuse_Pack.Internal.V) := 'a';
      Not_Direct_Vis.Internal_S (X_Unuse_Pack.Internal.V) := 'a';
      Direct_Vis (X_Unuse_Pack.Internal.V) := 'a';
      I1 := X_Unuse_Pack."-" (I1, 1);
      I2 := X_Unuse_Pack."+" (I2, 1);
      X_Unuse_Pack.Ptr.all := 3;
      X_Unuse_Pack.Ptr.all := 4;

      Enum := X_Unuse_Pack.A;
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);

      ND := X_Unuse_Pack.Dispatcher (X_Unuse_Pack.F);
      X_Unuse_Pack.Prim1 (D);
      X_Unuse_Pack.Prim1 (ND);
   end;

   declare
      
      
      
      D : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
      ND : X_Unuse_Pack.Dispatcher;
   begin
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
      I1 := X_Unuse_Pack."-" (I1, 1);
      I2 := X_Unuse_Pack."+" (I2, 1);
      X_Unuse_Pack.Ptr.all := 3;
      X_Unuse_Pack.Ptr.all := 4;

      ND := X_Unuse_Pack.Dispatcher (X_Unuse_Pack.F);
      X_Unuse_Pack.Prim1 (D);
      X_Unuse_Pack.Prim1 (ND);
   end;

   declare
      
      
      
      D : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
      ND : X_Unuse_Pack.Dispatcher;
   begin
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
      I1 := X_Unuse_Pack."-" (I1, 1);
      I2 := X_Unuse_Pack."+" (I2, 1);
      X_Unuse_Pack.Ptr.all := 3;
      X_Unuse_Pack.Ptr.all := 4;

      ND := X_Unuse_Pack.Dispatcher (X_Unuse_Pack.F);
      X_Unuse_Pack.Prim1 (D);
      X_Unuse_Pack.Prim1 (ND);
   end;

   -- Calls, dispatching calls and prefix notation
   declare
      
      VD : X_Unuse_Pack.Dispatcher;
      VDC : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
   begin
      X_Unuse_Pack.Prim1 (VD);
      X_Unuse_Pack.Prim1 (V => VD);
      VDC.Prim1;
      X_Unuse_Pack.Prim1 (X_Unuse_Pack.F);
      X_Unuse_Pack.F.Prim1;
      X_Unuse_Pack.Prim2 (X_Unuse_Pack.F, X_Unuse_Pack.G(VD));
      X_Unuse_Pack.F.Prim2 (VD.G);
   end;
end T_Unuse;
package X_Unuse_Pack is
   type Pack_Int1 is range 0 .. 10;
   type Pack_Int2 is range 0 .. 10;

   type Pack_Enum is (A, B, C);
   function "+" (L, R : Pack_Enum) return Pack_Enum;

   package Internal is
      V : Integer;
   end Internal;

   type Dispatcher is tagged null record;
   procedure Prim1 (V : Dispatcher);
   procedure Prim2 (V : Dispatcher; X : Integer);
   function F return Dispatcher'Class;
   function G (V : Dispatcher) return Integer;

   type Acc is access all Pack_Int1;
   Ptr : Acc;
end X_Unuse_Pack;
package body X_Unuse_Pack is
   function "+" (L, R : X_Unuse_Pack.Pack_Enum) return X_Unuse_Pack.Pack_Enum is
   begin
      return L;
   end "+";

   procedure Prim1 (V : X_Unuse_Pack.Dispatcher) is null;
   procedure Prim2 (V : X_Unuse_Pack.Dispatcher; X : Integer) is null;

   function F return X_Unuse_Pack.Dispatcher'Class is
   begin
      return X_Unuse_Pack.Dispatcher'(null record);
   end F;

   function G (V : X_Unuse_Pack.Dispatcher) return Integer is
   begin
      return 0;
   end G;

end X_Unuse_Pack;
with Ada.Strings.Unbounded;
with X_Unuse_Pack;
use type X_Unuse_Pack.Pack_Int2;
procedure T_Unuse is
   
--CHANGED:   use Ada, Ada.Strings, Ada.Strings.Unbounded;

   -- Various namings
   S1 : Ada.Strings.Unbounded.Unbounded_String;
--CHANGED:   S1 : Unbounded_String;
   S2 : Ada.Strings.Unbounded.Unbounded_String;
--CHANGED:   S2 : Unbounded.Unbounded_String;
   S3 : Ada.Strings.Unbounded.Unbounded_String;
--CHANGED:   S3 : Strings.Unbounded.Unbounded_String;

   I1 : aliased X_Unuse_Pack.Pack_Int1;
   I2 : X_Unuse_Pack.Pack_Int2;

   Enum : X_Unuse_Pack.Pack_Enum;

   -- Pragmas and attributes
   type Tab is array (1 .. 10) of Character;
   pragma Pack (Tab);
   for Tab'Size use 80;

   -- Don't apply to entities from Standard
   I_Standard : Integer := 3;
   Direct_Vis : String := Integer'Image (I_Standard);

   package Not_Direct_Vis is
      Internal_S : String := Integer'Image (I_Standard);
   end Not_Direct_Vis;
   
--CHANGED:   use Not_Direct_Vis;

begin
   -- Various usages
   S1 := Ada.Strings.Unbounded.Null_Unbounded_String;
--CHANGED:   S1 := Null_Unbounded_String;
   I_Standard := I_Standard + 2;

   declare
      
--CHANGED:      use X_Unuse_Pack;
      
--CHANGED:      use Internal;
      D : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
--CHANGED:      D : Dispatcher'Class := F;
      ND : X_Unuse_Pack.Dispatcher;
--CHANGED:      ND : Dispatcher;
   begin
      Direct_Vis (X_Unuse_Pack.Internal.V) := 'a';
--CHANGED:      Direct_Vis (V) := 'a';
      T_Unuse.Direct_Vis (X_Unuse_Pack.Internal.V) := 'a';
--CHANGED:      T_Unuse.Direct_Vis (Internal.V) := 'a';
      Not_Direct_Vis.Internal_S (X_Unuse_Pack.Internal.V) := 'a';
--CHANGED:      Internal_S (V) := 'a';
      Direct_Vis (X_Unuse_Pack.Internal.V) := 'a';
--CHANGED:      Direct_Vis (V) := 'a';
      I1 := X_Unuse_Pack."-" (I1, 1);
--CHANGED:      I1 := I1 - 1;
      I2 := I2 + 1;
      X_Unuse_Pack.Ptr.all := 3;
--CHANGED:      Ptr.all := 3;
      X_Unuse_Pack.Ptr.all := 4;

      Enum := X_Unuse_Pack.A;
--CHANGED:      Enum := A;
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
--CHANGED:      Enum := A + B;
      Enum := X_Unuse_Pack."+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
--CHANGED:      Enum := "+" (X_Unuse_Pack.A, B);

      ND := X_Unuse_Pack.Dispatcher (X_Unuse_Pack.F);
--CHANGED:      ND := Dispatcher (F);
      X_Unuse_Pack.Prim1 (D);
--CHANGED:      Prim1 (D);
      X_Unuse_Pack.Prim1 (ND);
--CHANGED:      Prim1 (ND);
   end;

   declare
      
--CHANGED:      use  X_Unuse_Pack;
      use all type X_Unuse_Pack.Pack_Enum, X_Unuse_Pack.Dispatcher;
      use all type X_Unuse_Pack.Pack_Int1;
--CHANGED:      use all type Pack_Int1;
      D : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
--CHANGED:      D : Dispatcher'Class := F;
      ND : X_Unuse_Pack.Dispatcher;
--CHANGED:      ND : Dispatcher;
   begin
      Enum := A + B;
      Enum := "+" (X_Unuse_Pack.A, B);
      I1 := I1 - 1;
      I2 := I2 + 1;
      X_Unuse_Pack.Ptr.all := 3;
--CHANGED:      Ptr.all := 3;
      X_Unuse_Pack.Ptr.all := 4;

      ND := X_Unuse_Pack.Dispatcher (X_Unuse_Pack.F);
--CHANGED:      ND := Dispatcher (F);
      X_Unuse_Pack.Prim1 (D);
--CHANGED:      Prim1 (D);
      X_Unuse_Pack.Prim1 (ND);
--CHANGED:      Prim1 (ND);
   end;

   declare
      
--CHANGED:      use  X_Unuse_Pack;
      use type X_Unuse_Pack.Pack_Enum, X_Unuse_Pack.Dispatcher;
      use type X_Unuse_Pack.Pack_Int1;
--CHANGED:      use type Pack_Int1;
      D : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
--CHANGED:      D : Dispatcher'Class := F;
      ND : X_Unuse_Pack.Dispatcher;
--CHANGED:      ND : Dispatcher;
   begin
      Enum := X_Unuse_Pack.A + X_Unuse_Pack.B;
--CHANGED:      Enum := A + B;
      Enum := "+" (X_Unuse_Pack.A, X_Unuse_Pack.B);
--CHANGED:      Enum := "+" (X_Unuse_Pack.A, B);
      I1 := I1 - 1;
      I2 := I2 + 1;
      X_Unuse_Pack.Ptr.all := 3;
--CHANGED:      Ptr.all := 3;
      X_Unuse_Pack.Ptr.all := 4;

      ND := X_Unuse_Pack.Dispatcher (X_Unuse_Pack.F);
--CHANGED:      ND := Dispatcher (F);
      X_Unuse_Pack.Prim1 (D);
--CHANGED:      Prim1 (D);
      X_Unuse_Pack.Prim1 (ND);
--CHANGED:      Prim1 (ND);
   end;

   -- Calls, dispatching calls and prefix notation
   declare
      
--CHANGED:      use X_Unuse_Pack;
      VD : X_Unuse_Pack.Dispatcher;
--CHANGED:      VD : Dispatcher;
      VDC : X_Unuse_Pack.Dispatcher'Class := X_Unuse_Pack.F;
--CHANGED:      VDC : Dispatcher'Class := F;
   begin
      X_Unuse_Pack.Prim1 (VD);
--CHANGED:      Prim1 (VD);
      X_Unuse_Pack.Prim1 (V => VD);
--CHANGED:      Prim1 (V => VD);
      VDC.Prim1;
      X_Unuse_Pack.Prim1 (X_Unuse_Pack.F);
--CHANGED:      Prim1 (F);
      X_Unuse_Pack.F.Prim1;
--CHANGED:      F.Prim1;
      X_Unuse_Pack.Prim2 (X_Unuse_Pack.F, X_Unuse_Pack.G(VD));
--CHANGED:      Prim2 (F, G(VD));
      X_Unuse_Pack.F.Prim2 (VD.G);
--CHANGED:      F.Prim2 (VD.G);
   end;
end T_Unuse;
package X_Unuse_Pack is
   type Pack_Int1 is range 0 .. 10;
   type Pack_Int2 is range 0 .. 10;

   type Pack_Enum is (A, B, C);
   function "+" (L, R : Pack_Enum) return Pack_Enum;

   package Internal is
      V : Integer;
   end Internal;

   type Dispatcher is tagged null record;
   procedure Prim1 (V : Dispatcher);
   procedure Prim2 (V : Dispatcher; X : Integer);
   function F return Dispatcher'Class;
   function G (V : Dispatcher) return Integer;

   type Acc is access all Pack_Int1;
   Ptr : Acc;
end X_Unuse_Pack;
package body X_Unuse_Pack is
   function "+" (L, R : X_Unuse_Pack.Pack_Enum) return X_Unuse_Pack.Pack_Enum is
--CHANGED:   function "+" (L, R : Pack_Enum) return Pack_Enum is
   begin
      return L;
   end "+";

   procedure Prim1 (V : X_Unuse_Pack.Dispatcher) is null;
--CHANGED:   procedure Prim1 (V : Dispatcher) is null;
   procedure Prim2 (V : X_Unuse_Pack.Dispatcher; X : Integer) is null;
--CHANGED:   procedure Prim2 (V : Dispatcher; X : Integer) is null;

   function F return X_Unuse_Pack.Dispatcher'Class is
--CHANGED:   function F return Dispatcher'Class is
   begin
      return X_Unuse_Pack.Dispatcher'(null record);
--CHANGED:      return Dispatcher'(null record);
   end F;

   function G (V : X_Unuse_Pack.Dispatcher) return Integer is
--CHANGED:   function G (V : Dispatcher) return Integer is
   begin
      return 0;
   end G;

end X_Unuse_Pack;
