summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cofove.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-cofove.adb')
-rw-r--r--gcc/ada/a-cofove.adb17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ada/a-cofove.adb b/gcc/ada/a-cofove.adb
index 240715dca75..93372e1c5cb 100644
--- a/gcc/ada/a-cofove.adb
+++ b/gcc/ada/a-cofove.adb
@@ -301,10 +301,10 @@ package body Ada.Containers.Formal_Vectors is
begin
if Capacity = 0 then
C := LS;
- elsif Capacity >= LS then
+ elsif Capacity >= LS and then Capacity in Capacity_Range then
C := Capacity;
else
- raise Constraint_Error;
+ raise Capacity_Error;
end if;
return Target : Vector (C) do
@@ -1506,6 +1506,19 @@ package body Ada.Containers.Formal_Vectors is
end;
end Set_Length;
+ ------------------
+ -- Strict_Equal --
+ ------------------
+
+ function Strict_Equal (Left, Right : Vector) return Boolean is
+ begin
+ -- On bounded vectors, cursors are indexes. As a consequence, two
+ -- vectors always have the same cursor at the same position and
+ -- Strict_Equal is simply =
+
+ return Left = Right;
+ end Strict_Equal;
+
----------
-- Swap --
----------