https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113781
Bug ID: 113781 Summary: Bug box on array initialisation with iterated aggregate component Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: laguest at archeia dot com CC: dkm at gcc dot gnu.org Target Milestone: --- procedure array_test is Size : constant := 4; type Vector is array (Natural range <>) of Integer; type Matrix is array (Natural range <>, Natural range <>) of Integer; type Combined (Which : Natural) is record case Which is when 0 => V : Vector (1 .. Size * Size); when 1 => M : Matrix (1 .. Size, 1 .. Size); when others => null; end case; end record; V : constant Vector := [for I in 1 .. Size => I]; M : constant Combined := (Which => 0, V => for I in 1 .. Size * Size => I); begin null; end array_test; ⓘ Building matrix_test=0.1.0-dev/matrix_test.gpr... Compile [Ada] array_test.adb +===========================GNAT BUG DETECTED==============================+ | 13.2.1 20231014 (x86_64-pc-linux-gnu) Program_Error sem_util.adb:7351 explicit raise| | Error detected at array_test.adb:20:51 | | Compiling /home/laguest/src/mine-new/matrix_test/src/array_test.adb | | Please submit a bug report; see https://gcc.gnu.org/bugs/ . | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact command that you entered. | | Also include sources listed below. | +==========================================================================+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. Consider also -gnatd.n switch (see debug.adb). /home/laguest/src/mine-new/matrix_test/src/array_test.adb compilation abandoned compilation of array_test.adb failed gprbuild: *** compilation phase failed error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/laguest/src/mine-new/matrix_test/matrix_test.gpr"] exited with code 4 error: Compilation failed. Compiled with -O2, that is the only flag.