[Ada] Add Depends contracts to Delete procedures of formal containers
authorClaire Dross <dross@adacore.com>
Mon, 10 Feb 2020 11:30:40 +0000 (12:30 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 8 Jun 2020 07:50:52 +0000 (03:50 -0400)
2020-06-08  Claire Dross  <dross@adacore.com>

gcc/ada/

* libgnat/a-cfdlli.ads, libgnat/a-cfhama.ads,
libgnat/a-cfhase.ads, libgnat/a-cforma.ads, libgnat/a-cforse.ads
(Delete): Add Depends contract.

gcc/ada/libgnat/a-cfdlli.ads
gcc/ada/libgnat/a-cfhama.ads
gcc/ada/libgnat/a-cfhase.ads
gcc/ada/libgnat/a-cforma.ads
gcc/ada/libgnat/a-cforse.ads

index 426a584..6131239 100644 (file)
@@ -789,9 +789,10 @@ is
                 Count => Count);
 
    procedure Delete (Container : in out List; Position : in out Cursor) with
-     Global => null,
-     Pre    => Has_Element (Container, Position),
-     Post   =>
+     Global  => null,
+     Depends => (Container =>+ Position, Position => null),
+     Pre     => Has_Element (Container, Position),
+     Post    =>
        Length (Container) = Length (Container)'Old - 1
 
          --  Position is set to No_Element
index 7b50096..8a73508 100644 (file)
@@ -669,9 +669,10 @@ is
                 Find (Container, Key)'Old);
 
    procedure Delete (Container : in out Map; Position : in out Cursor) with
-     Global => null,
-     Pre    => Has_Element (Container, Position),
-     Post   =>
+     Global  => null,
+     Depends => (Container =>+ Position, Position => null),
+     Pre     => Has_Element (Container, Position),
+     Post    =>
        Position = No_Element
          and Length (Container) = Length (Container)'Old - 1
 
index 3667357..37022ca 100644 (file)
@@ -801,9 +801,10 @@ is
    --  already in the set.)
 
    procedure Delete (Container : in out Set; Position : in out Cursor) with
-     Global => null,
-     Pre    => Has_Element (Container, Position),
-     Post   =>
+     Global  => null,
+     Depends => (Container =>+ Position, Position => null),
+     Pre     => Has_Element (Container, Position),
+     Post    =>
        Position = No_Element
          and Length (Container) = Length (Container)'Old - 1
 
index acedbe4..99b02a5 100644 (file)
@@ -733,9 +733,10 @@ is
                 Cut   => Find (Keys (Container), Key)'Old);
 
    procedure Delete (Container : in out Map; Position : in out Cursor) with
-     Global => null,
-     Pre    => Has_Element (Container, Position),
-     Post   =>
+     Global  => null,
+     Depends => (Container =>+ Position, Position => null),
+     Pre     => Has_Element (Container, Position),
+     Post    =>
        Position = No_Element
          and Length (Container) = Length (Container)'Old - 1
 
index 77fc0b4..a818726 100644 (file)
@@ -858,9 +858,10 @@ is
      (Container : in out Set;
       Position  : in out Cursor)
    with
-     Global => null,
-     Pre    => Has_Element (Container, Position),
-     Post   =>
+     Global  => null,
+     Depends => (Container =>+ Position, Position => null),
+     Pre     => Has_Element (Container, Position),
+     Post    =>
        Position = No_Element
          and Length (Container) = Length (Container)'Old - 1