[Ada] Crash on limited array object with address clause
authorEd Schonberg <schonberg@adacore.com>
Fri, 16 Apr 2021 16:52:50 +0000 (12:52 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 29 Jun 2021 14:23:48 +0000 (14:23 +0000)
commita671959b7640b1b02c924292959f2cbe1574536a
tree8f68ef3183b5bb11496267051c57626a483557c4
parent38b57d67e85df1636c5e4300defe337e28878412
[Ada] Crash on limited array object with address clause

gcc/ada/

* exp_aggr.adb (Convert_Aggr_In_Object_Decl): After expansion of
the aggregate, the expression can be removed from the
declaration, except if the object is class-wide, in which case
the aggregate provides the actual type. In other cases the
presence of the expression may lead to spurious freezing issue.
* exp_ch3.adb (Expand_N_Object_Declaration): If the expression
in the declaration is an aggregate with delayed expansion (as is
the case for objects of a limited type, or a subsequent address
specification) the aggregate must be resolved at this point.
This resolution must not include expansion, because the
expansion of the enclosing declaration will construct the
necessary aggregate expansion.
gcc/ada/exp_aggr.adb
gcc/ada/exp_ch3.adb