1-- { dg-do compile } 2-- { dg-options "-O" } 3 4package Opt4 is 5 6 type Rec (D : Boolean := False) is record 7 case D is 8 when False => null; 9 when True => I : Integer; 10 end case; 11 end record; 12 13 Null_Rec : constant Rec := (D => False); 14 15 type I1 is limited interface; 16 17 type I2 is limited interface; 18 19 function Func (Data : I2) return Rec is abstract; 20 21 type Ext is limited new I1 and I2 with null record; 22 23 overriding function Func (Data : Ext) return Rec is (Null_Rec); 24 25end Opt4; 26