aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/warn17.adb
blob: 6d48e5416a54297543a46b8298695300449c3bec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--  { dg-do compile }
--  { dg-options "-Wall" }

with Ada.Iterator_Interfaces;

procedure Warn17 is

   type Cursor is null record;

   function Has_Element (Position : Cursor) return Boolean;

   function Has_Element (Position : Cursor) return Boolean is (True);

   package My_Iterator is
     new Ada.Iterator_Interfaces (Cursor, Has_Element);

   type Iterator is abstract new My_Iterator.Forward_Iterator with null record;

   pragma Unreferenced (Iterator);
begin
   null;
end Warn17;