]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix packed boolean array with Default_Component_Value aspect
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 17 Jan 2026 21:27:53 +0000 (22:27 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Sat, 17 Jan 2026 21:39:03 +0000 (22:39 +0100)
commitcda2b46c68bbc5d3c87593c802bdddb5ebc09b41
tree395eff4616a599030861dc73d353f9b9ea114745
parentc53c1ce78e2bdcefd7a08fd63ff8d092f4b309ed
Ada: Fix packed boolean array with Default_Component_Value aspect

Putting the Default_Component_Value aspect on a bit-packed array type has
never worked, so this plugs the loophole.  For the sake of consistency,
the recent fix for PR ada/68179 is adjusted to use Has_Default_Aspect too.

gcc/ada/
PR ada/68179
PR ada/123589
* exp_ch3.adb (Expand_Freeze_Array_Type): Build an initialization
procedure for a bit-packed array type if Has_Default_Aspect is set
on the base type, but make sure not to build it twice.  Also test
Has_Default_Aspect for a type derived from String.

gcc/testsuite/
* gnat.dg/component_value2.adb: New test.

Co-authored-by: Lisa Felidae <lisa@felidae.bam.moe>
gcc/ada/exp_ch3.adb
gcc/testsuite/gnat.dg/component_value2.adb [new file with mode: 0644]