diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-11-21 12:22:47 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-11-21 12:22:47 +0100 |
commit | bdf69d333e4c6d080e8be3ad9d71fb1895e85d03 (patch) | |
tree | d7c262a43cb5289678f60e01f197e231069e0715 /gcc/ada/a-cfdlli.adb | |
parent | f3670c001ceb35a4922552aaf7be7fe47c2c7c07 (diff) | |
download | gcc-bdf69d333e4c6d080e8be3ad9d71fb1895e85d03.tar.gz |
[multiple changes]
2011-11-21 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Actuals): In Ada 2012, a function call
with out parameters may generate assignments to force constraint
checks. These checks must be properly placed in the code after the
declaration or statement that contains the call.
2011-11-21 Fedor Rybin <frybin@adacore.com>
* gnat_ugn.texi: Adding info on current gnattest limitations an
support of -X option.
2011-11-21 Robert Dewar <dewar@adacore.com>
* a-cfdlli.adb, a-cbdlli.adb: Minor reformatting.
From-SVN: r181559
Diffstat (limited to 'gcc/ada/a-cfdlli.adb')
-rw-r--r-- | gcc/ada/a-cfdlli.adb | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/gcc/ada/a-cfdlli.adb b/gcc/ada/a-cfdlli.adb index d1bd218972d..3c73c0467aa 100644 --- a/gcc/ada/a-cfdlli.adb +++ b/gcc/ada/a-cfdlli.adb @@ -743,7 +743,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is begin if Before.Node /= 0 then - null; pragma Assert (Vet (Container, Before), "bad cursor in Insert"); end if; @@ -793,7 +792,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is begin if Before.Node /= 0 then - null; pragma Assert (Vet (Container, Before), "bad cursor in Insert"); end if; @@ -1008,7 +1006,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is Clear (Target); while Source.Length > 1 loop - pragma Assert (Source.First in 1 .. Source.Capacity); pragma Assert (Source.Last /= Source.First); pragma Assert (N (Source.First).Prev = 0); @@ -1034,18 +1031,16 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is -- in the unbounded form of the doubly-linked list container. In that -- case, Free is an instantation of Unchecked_Deallocation, which can -- fail (because PE will be raised if controlled Finalize fails), so - -- we must defer the call until the very last step. Here in the - -- bounded form, Free merely links the node we have just - -- "deallocated" onto a list of inactive nodes, so technically Free - -- cannot fail. However, for consistency, we handle Free the same way - -- here as we do for the unbounded form, with the pessimistic - -- assumption that it can fail. + -- we must defer the call until the last step. Here in the bounded + -- form, Free merely links the node we have just "deallocated" onto a + -- list of inactive nodes, so technically Free cannot fail. However, + -- for consistency, we handle Free the same way here as we do for the + -- unbounded form, with the pessimistic assumption that it can fail. Free (Source, X); end loop; if Source.Length = 1 then - pragma Assert (Source.First in 1 .. Source.Capacity); pragma Assert (Source.Last = Source.First); pragma Assert (N (Source.First).Prev = 0); @@ -1221,8 +1216,8 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is "attempt to tamper with cursors (list is locked)"; end if; - pragma Assert (Vet (Container, Position), - "bad cursor in Replace_Element"); + pragma Assert + (Vet (Container, Position), "bad cursor in Replace_Element"); declare N : Node_Array renames Container.Nodes; @@ -1421,7 +1416,6 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is begin if Before.Node /= 0 then - null; pragma Assert (Vet (Target, Before), "bad cursor in Splice"); end if; @@ -1513,17 +1507,16 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is begin if Before.Node /= 0 then - null; - pragma Assert (Vet (Container, Before), - "bad Before cursor in Splice"); + pragma Assert + (Vet (Container, Before), "bad Before cursor in Splice"); end if; if Position.Node = 0 then raise Constraint_Error with "Position cursor has no element"; end if; - pragma Assert (Vet (Container, Position), - "bad Position cursor in Splice"); + pragma Assert + (Vet (Container, Position), "bad Position cursor in Splice"); if Position.Node = Before.Node or else N (Position.Node).Next = Before.Node @@ -1732,8 +1725,8 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is raise Constraint_Error with "Position cursor has no element"; end if; - pragma Assert (Vet (Container, Position), - "bad cursor in Update_Element"); + pragma Assert + (Vet (Container, Position), "bad cursor in Update_Element"); declare B : Natural renames Container.Busy; |