| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-O" } |
| 3 |
|
| 4 |
with Ada.Containers.Ordered_Sets; |
| 5 |
with Ada.Strings.Unbounded; |
| 6 |
|
| 7 |
procedure Opt33 is |
| 8 |
|
| 9 |
type Rec is record |
| 10 |
Name : Ada.Strings.Unbounded.Unbounded_String; |
| 11 |
end record; |
| 12 |
|
| 13 |
function "<" (Left : Rec; Right : Rec) return Boolean; |
| 14 |
|
| 15 |
package My_Ordered_Sets is new Ada.Containers.Ordered_Sets (Rec); |
| 16 |
|
| 17 |
protected type Data is |
| 18 |
procedure Do_It; |
| 19 |
private |
| 20 |
Set : My_Ordered_Sets.Set; |
| 21 |
end Data; |
| 22 |
|
| 23 |
function "<" (Left : Rec; Right : Rec) return Boolean is |
| 24 |
begin |
| 25 |
return False; |
| 26 |
end "<"; |
| 27 |
|
| 28 |
protected body Data is |
| 29 |
procedure Do_It is |
| 30 |
procedure Dummy (Position : My_Ordered_Sets.Cursor) is |
| 31 |
begin |
| 32 |
null; |
| 33 |
end; |
| 34 |
begin |
| 35 |
Set.Iterate (Dummy'Access); |
| 36 |
end; |
| 37 |
end Data; |
| 38 |
|
| 39 |
begin |
| 40 |
null; |
| 41 |
end; |