[Bug ada/123306] assertion failure for unfrozen mutably tagged type as actual in instance
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 27 20:46:38 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123306
--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Eric Botcazou
<ebotcazou@gcc.gnu.org>:
https://gcc.gnu.org/g:304a75b1b2a748e8bb94fd80a31a6e20da7fe6e8
commit r15-10869-g304a75b1b2a748e8bb94fd80a31a6e20da7fe6e8
Author: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri Feb 27 19:54:33 2026 +0100
Ada: Fix assertion failure for unfrozen mutably tagged type as actual
This is a follow-up to the fix done last December at:
https://gcc.gnu.org/pipermail/gcc-patches/2025-December/704521.html
The fix is not sufficient when nested layers of generics are involved,
so this changes the implementation of mutably tagged types to have the
declaration of their CW-equivalent type immediately analyzed. But this
in turn requires making sure that the root type is frozen before the
CW-equivalent type in all cases.
gcc/ada/
PR ada/123306
* freeze.adb (Freeze_Entity): For a class-wide equivalent type of
a non-interface root type, freeze the root type before it.
* sem_ch3.adb (Derived_Type_Declaration): Minor tweak.
* sem_ch12.adb (Analyze_One_Association): Revert latest change.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause) <Size>: When
the prefix is a class-wide type, insert the declaration of the CW-
equivalent type immediately after that of the root type, and the
size check for the root type into its own freezing actions.
gcc/testsuite/
* gnat.dg/specs/mutably_tagged2.ads: New test.
More information about the Gcc-bugs
mailing list