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

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

--  { dg-do compile }

procedure Interface6 is

     type TI  is interface;
     type TI2 is interface;

     type Rec_Type is tagged null record;

     type Rec_Type1 is new TI
     with
     record
         A : Integer;
     end record;

     type Rec_Type2 is new Rec_Type1 and TI2
     with
     record
         B : Integer;
     end record;

     type Rec_Type12 is new Rec_Type1 and TI and TI2
     with
     record
         C : Integer;
     end record;

     generic
         type T is new Rec_Type1 and TI2 with private;
     procedure Test;

     procedure Test is
     begin
         null;
     end Test;

     procedure Test_Instance1 is new Test (T => Rec_Type);  --  { dg-error "actual must implement all interfaces of formal \"T\"" }
     procedure Test_Instance1 is new Test (T => Rec_Type1);  -- { dg-error "Actual \"Rec_Type1\" must implement interface \"TI2\"" }
     procedure Test_Instance2 is new Test (T => Rec_Type2);
     procedure Test_Instance12 is new Test (T => Rec_Type12);

begin
     null;
end Interface6;