view gcc/testsuite/gnat.dg/opt33.adb @ 138:fc828634a951

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 08 Nov 2018 14:17:14 +0900
parents 04ced10e8804
children
line wrap: on
line source

-- { dg-do compile }
-- { dg-options "-O" }

with Ada.Containers.Ordered_Sets;
with Ada.Strings.Unbounded;

procedure Opt33 is

   type Rec is record
      Name : Ada.Strings.Unbounded.Unbounded_String;
   end record;

   function "<" (Left : Rec; Right : Rec) return Boolean;

   package My_Ordered_Sets is new Ada.Containers.Ordered_Sets (Rec);

   protected type Data is
      procedure Do_It;
   private
      Set : My_Ordered_Sets.Set;
   end Data;

   function "<" (Left : Rec; Right : Rec) return Boolean is
   begin
      return False;
   end "<";

   protected body Data is
      procedure Do_It is
         procedure Dummy (Position : My_Ordered_Sets.Cursor) is
         begin
            null;
         end;
      begin
         Set.Iterate (Dummy'Access);
      end;
   end Data;

begin
   null;
end;