diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-25 19:53:00 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-25 19:53:00 +0000 |
commit | 20e31e42626c109b96cb044d39a574ef6f18986e (patch) | |
tree | 2eee449e7a4167a1bc1ec3b3986113b2a1923516 /gcc/ada/a-cbmutr.adb | |
parent | 7b7f33670b97cb646d94435df4e390e4f9264bd4 (diff) | |
download | gcc-20e31e42626c109b96cb044d39a574ef6f18986e.tar.gz |
2014-02-25 Basile Starynkevitch <basile@starynkevitch.net>
{{merge using svnmerge.py with trunk GCC 4.9 svn
rev.208153. Notice that svn 1.8.8 crashes while doing this, so
merged with svn 1.7.14... All is well compiled.}}
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@208154 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-cbmutr.adb')
-rw-r--r-- | gcc/ada/a-cbmutr.adb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ada/a-cbmutr.adb b/gcc/ada/a-cbmutr.adb index 536f00afdb3..aa754149067 100644 --- a/gcc/ada/a-cbmutr.adb +++ b/gcc/ada/a-cbmutr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2011-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 2011-2013, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -397,7 +397,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is end if; if Container.Count > Container.Capacity - Count then - raise Constraint_Error + raise Capacity_Error with "requested count exceeds available storage"; end if; @@ -1538,7 +1538,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is end if; if Container.Count > Container.Capacity - Count then - raise Constraint_Error + raise Capacity_Error with "requested count exceeds available storage"; end if; @@ -1585,6 +1585,10 @@ package body Ada.Containers.Bounded_Multiway_Trees is Nodes : Tree_Node_Array renames Container.Nodes; Last : Count_Type; + New_Item : Element_Type; + pragma Unmodified (New_Item); + -- OK to reference, see below + begin if Parent = No_Element then raise Constraint_Error with "Parent cursor has no element"; @@ -1610,7 +1614,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is end if; if Container.Count > Container.Capacity - Count then - raise Constraint_Error + raise Capacity_Error with "requested count exceeds available storage"; end if; @@ -1623,7 +1627,13 @@ package body Ada.Containers.Bounded_Multiway_Trees is Initialize_Root (Container); end if; - Allocate_Node (Container, Position.Node); + -- There is no explicit element provided, but in an instance the element + -- type may be a scalar with a Default_Value aspect, or a composite + -- type with such a scalar component, or components with default + -- initialization, so insert the specified number of possibly + -- initialized elements at the given position. + + Allocate_Node (Container, New_Item, Position.Node); Nodes (Position.Node).Parent := Parent.Node; Last := Position.Node; @@ -2227,7 +2237,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is end if; if Container.Count > Container.Capacity - Count then - raise Constraint_Error + raise Capacity_Error with "requested count exceeds available storage"; end if; |