view gcc/testsuite/gnat.dg/interface6.adb @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +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;