summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cihama.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-cihama.adb')
-rw-r--r--gcc/ada/a-cihama.adb18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/a-cihama.adb b/gcc/ada/a-cihama.adb
index 3f5b7ec5bd8..2ea73b9f960 100644
--- a/gcc/ada/a-cihama.adb
+++ b/gcc/ada/a-cihama.adb
@@ -695,12 +695,15 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
Position.Node.Key := new Key_Type'(Key);
declare
- pragma Unsuppress (Accessibility_Check);
-- The element allocator may need an accessibility check in the
-- case the actual type is class-wide or has access discriminants
-- (see RM 4.8(10.1) and AI12-0035).
+
+ pragma Unsuppress (Accessibility_Check);
+
begin
Position.Node.Element := new Element_Type'(New_Item);
+
exception
when others =>
Free_Key (K);
@@ -736,14 +739,16 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
K : Key_Access := new Key_Type'(Key);
E : Element_Access;
- pragma Unsuppress (Accessibility_Check);
-- The element allocator may need an accessibility check in the case
-- the actual type is class-wide or has access discriminants (see
-- RM 4.8(10.1) and AI12-0035).
+ pragma Unsuppress (Accessibility_Check);
+
begin
E := new Element_Type'(New_Item);
return new Node_Type'(K, E, Next);
+
exception
when others =>
Free_Key (K);
@@ -1177,12 +1182,15 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
Node.Key := new Key_Type'(Key);
declare
- pragma Unsuppress (Accessibility_Check);
-- The element allocator may need an accessibility check in the case
-- the actual type is class-wide or has access discriminants (see
-- RM 4.8(10.1) and AI12-0035).
+
+ pragma Unsuppress (Accessibility_Check);
+
begin
Node.Element := new Element_Type'(New_Item);
+
exception
when others =>
Free_Key (K);
@@ -1230,10 +1238,12 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
declare
X : Element_Access := Position.Node.Element;
- pragma Unsuppress (Accessibility_Check);
-- The element allocator may need an accessibility check in the case
-- the actual type is class-wide or has access discriminants (see
-- RM 4.8(10.1) and AI12-0035).
+
+ pragma Unsuppress (Accessibility_Check);
+
begin
Position.Node.Element := new Element_Type'(New_Item);
Free_Element (X);