diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-29 10:25:10 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-29 10:25:10 +0000 |
commit | 89cc7147fbacb5e850051c7996fe510d4379253d (patch) | |
tree | 7231c914b20a6192d1398f725c6a779419140c9a /gcc/ada/a-cimutr.adb | |
parent | 01f9c5cd4a1212826adc7a906db50bd93df8c8cd (diff) | |
download | gcc-89cc7147fbacb5e850051c7996fe510d4379253d.tar.gz |
2011-08-29 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb: Additional semantic checks for aspects involved in
iterators.
2011-08-29 Matthew Heaney <heaney@adacore.com>
* a-comutr.ads, a-comutr.adb, a-cimutr.ads, a-cimutr.adb,
a-cbmutr.ads, a-cbmutr.adb (Find_In_Subtree): Remove superfluous
Container parameter.
(Ancestor_Find): ditto.
2011-08-29 Robert Dewar <dewar@adacore.com>
* par-endh.adb: Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178190 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-cimutr.adb')
-rw-r--r-- | gcc/ada/a-cimutr.adb | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/gcc/ada/a-cimutr.adb b/gcc/ada/a-cimutr.adb index add76057d73..90fedaef0e1 100644 --- a/gcc/ada/a-cimutr.adb +++ b/gcc/ada/a-cimutr.adb @@ -164,21 +164,21 @@ package body Ada.Containers.Indefinite_Multiway_Trees is ------------------- function Ancestor_Find - (Container : Tree; - Item : Element_Type; - Position : Cursor) return Cursor + (Position : Cursor; + Item : Element_Type) return Cursor is - R : constant Tree_Node_Access := Root_Node (Container); - N : Tree_Node_Access; + R, N : Tree_Node_Access; begin if Position = No_Element then raise Constraint_Error with "Position cursor has no element"; end if; - if Position.Container /= Container'Unrestricted_Access then - raise Program_Error with "Position cursor not in container"; - end if; + -- Commented-out pending ARG ruling. ??? + + -- if Position.Container /= Container'Unrestricted_Access then + -- raise Program_Error with "Position cursor not in container"; + -- end if; -- AI-0136 says to raise PE if Position equals the root node. This does -- not seem correct, as this value is just the limiting condition of the @@ -188,10 +188,11 @@ package body Ada.Containers.Indefinite_Multiway_Trees is -- raise Program_Error with "Position cursor designates root"; -- end if; + R := Root_Node (Position.Container.all); N := Position.Node; while N /= R loop if N.Element.all = Item then - return Cursor'(Container'Unrestricted_Access, N); + return Cursor'(Position.Container, N); end if; N := N.Parent; @@ -974,9 +975,8 @@ package body Ada.Containers.Indefinite_Multiway_Trees is --------------------- function Find_In_Subtree - (Container : Tree; - Item : Element_Type; - Position : Cursor) return Cursor + (Position : Cursor; + Item : Element_Type) return Cursor is Result : Tree_Node_Access; @@ -985,9 +985,11 @@ package body Ada.Containers.Indefinite_Multiway_Trees is raise Constraint_Error with "Position cursor has no element"; end if; - if Position.Container /= Container'Unrestricted_Access then - raise Program_Error with "Position cursor not in container"; - end if; + -- Commented-out pending ruling from ARG. ??? + + -- if Position.Container /= Container'Unrestricted_Access then + -- raise Program_Error with "Position cursor not in container"; + -- end if; if Is_Root (Position) then Result := Find_In_Children (Position.Node, Item); @@ -1000,7 +1002,7 @@ package body Ada.Containers.Indefinite_Multiway_Trees is return No_Element; end if; - return Cursor'(Container'Unrestricted_Access, Result); + return Cursor'(Position.Container, Result); end Find_In_Subtree; function Find_In_Subtree |