summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cidlli.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-cidlli.adb')
-rw-r--r--gcc/ada/a-cidlli.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/a-cidlli.adb b/gcc/ada/a-cidlli.adb
index cc93b4c2fc0..fafe6719170 100644
--- a/gcc/ada/a-cidlli.adb
+++ b/gcc/ada/a-cidlli.adb
@@ -888,9 +888,19 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
end if;
declare
+ -- 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). We don't unsuppress the check on the
+ -- allocator in the loop below, because the one in this block would
+ -- have failed already.
+
+ pragma Unsuppress (Accessibility_Check);
+
Element : Element_Access := new Element_Type'(New_Item);
+
begin
New_Node := new Node_Type'(Element, null, null);
+
exception
when others =>
Free (Element);
@@ -1461,6 +1471,12 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
pragma Assert (Vet (Position), "bad cursor in Replace_Element");
declare
+ -- 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);
+
X : Element_Access := Position.Node.Element;
begin