view gcc/testsuite/gnat.dg/raise_expr.adb @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

--  { dg-do compile }

procedure Raise_Expr is

   E : exception;

   type T is tagged limited null record;
   type TC is new T with null record;

   function F0 return Boolean is
   begin
       return raise E;
   end;

   function F return T'Class is
     TT : T;
   begin
      return raise E; -- Causes compile-time crash
   end F;

begin
   declare
      O : T'class  := F;
   begin
      null;
   end;
end Raise_Expr;