ubuntu-buildroot/output/build/host-gcc-initial-11.4.0/gcc/testsuite/gnat.dg/warn16.adb

39 lines
914 B
Ada
Raw Permalink Normal View History

2024-04-01 15:19:46 +00:00
-- { dg-do compile }
-- { dg-options "-gnatwa" }
procedure Warn16 is
package Define is
type Key_Type is record
Value : Integer := 0;
end record;
function "=" (Left : in Key_Type;
Right : in Key_Type)
return Boolean;
end;
package body Define is
function "=" (Left : in Key_Type;
Right : in Key_Type)
return Boolean is
begin
return Left.Value = Right.Value;
end;
end;
generic
type Key_Type is private;
with function "=" (Left : in Key_Type;
Right : in Key_Type)
return Boolean;
package Oper is end;
use type Define.Key_Type; -- !!!
package Inst is new Oper (Key_Type => Define.Key_Type,
"=" => "=");
pragma Unreferenced (Inst);
begin
null;
end;