]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix support of Default_Component_Value aspect on derived types
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 5 Dec 2022 21:31:50 +0000 (22:31 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 3 Jan 2023 09:29:52 +0000 (10:29 +0100)
commite1e2b0070302169fbf3f3fd95a13ec819e71e2a5
tree673a5901734022780dec8ae59d78801f889968aa
parentfee53a3194c0d8b747486b23980f1214cc1355b9
ada: Fix support of Default_Component_Value aspect on derived types

The support of the Default_Component_Value aspect on derived constrained
array types is broken because of a couple of issues: 1) the derived types
incorrectly inherit the initialization procedure of the ancestor types
and 2) the propagation of the aspect does not work for constrained array
types (unlike for unconstrained array types).

gcc/ada/

* exp_tss.adb (Base_Init_Proc): Do not return the Init_Proc of the
ancestor type for a derived array type.
* sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): Factor out the
common processing done on representation items.
For Default_Component_Value and Default_Value, look into the first
subtype to find out the representation items.
gcc/ada/exp_tss.adb
gcc/ada/sem_ch13.adb