view gcc/testsuite/gnat.dg/specs/discr4_pkg.ads @ 138:fc828634a951

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

package Discr4_Pkg is

   type Enum is (One, Two, Three);

   type Rec is private;

   Rec_One : constant Rec;
   Rec_Three  : constant Rec;

   function Get (Value : Integer) return Rec;

private

   type Rec (D : Enum := Two) is record
      case D is
         when One => null;
         when Two => Value : Integer;
         when Three => null;
      end case;
   end record;

   Rec_One   : constant Rec := (D => One);
   Rec_Three : constant Rec := (D => Three);

   function Get (Value : Integer) return Rec is (Two, Value);

end Discr4_Pkg;