c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / gnat.dg / derived_type2.adb
blob607eb0b22c4624aed5008e28212f5f81315bfbcd
1 -- { dg-do run }
2 -- { dg-options "-gnatws" }
4 procedure Derived_Type2 is
6 package Pkg is
8 type Parent (B : Boolean := True) is record
9 case B is
10 when True => S : String (1 .. 5);
11 when False => F : Float;
12 end case;
13 end record;
15 function Create (X : Parent) return Parent;
17 end Pkg;
19 package body Pkg is
21 function Create (X : Parent) return Parent is
22 begin
23 return (True, "12345");
24 end;
26 end Pkg;
28 use Pkg;
30 type T is new Parent (True);
32 X : T;
34 begin
36 if Create (X).B /= True then
37 raise Program_Error;
38 end if;
40 end;