]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix assertion failure on Finalizable aspect for tagged record type
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 5 May 2025 10:58:58 +0000 (12:58 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 5 May 2025 11:02:54 +0000 (13:02 +0200)
commit37c312486186ed9dc2561b2e341fd81f4f1627ec
tree157694c64452cf982418788623cc07e4e2f862b5
parent055434ca127c4724f061048b835b8434dd4724b8
Ada: Fix assertion failure on Finalizable aspect for tagged record type

This is a (benign) assertion failure on the mainline for the new Finalizable
aspect put on a tagged record type when not all the primitives are declared.
This compiles and runs on the 15 branch because assertions are disabled.

gcc/ada/
PR ada/120104
* exp_ch3.adb (Expand_Freeze_Record_Type): For a controlled tagged
type, freeze only the controlled primitives that are present.

gcc/testsuite/
* gnat.dg/specs/finalizable1.ads: New test.
gcc/ada/exp_ch3.adb
gcc/testsuite/gnat.dg/specs/finalizable1.ads [new file with mode: 0644]