https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120546

            Bug ID: 120546
           Summary: Array aggregate inside record aggregate inside generic
                    package instantiation breaks Dimension_System
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liam at liampwll dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

The following code outputs `expected dimension [T], found []` even though the
dimension is clearly correct. It also does this even if a cast is used instead
of multiplication. This only occurs when a record aggregate, array aggregate,
and generic package instantiation are present, if any are removes then the code
compiles as expected.

pragma Ada_2022;

with System.Dim.Mks; use System.Dim.Mks;

procedure Tmp_Ada is
   type Rec is record
      T : Time;
   end record;

   type Arr is array (Boolean) of Rec;

   generic
      Foo : Arr;
   package Bar is
   end Bar;

   package My_Bar is new Bar ((others => (T => 1.0 * s)));
begin
   null;
end Tmp_Ada;

Reply via email to