]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Fix missing error on 'Access of constrained array
authorBob Duff <duff@adacore.com>
Wed, 25 May 2022 15:51:52 +0000 (11:51 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 4 Jul 2022 07:45:56 +0000 (07:45 +0000)
commit3319015b0a498ed1050d6910f75430a6fc401f50
tree6fd43b44b2e5cd783ca893ed67c19599a9e15069
parent02e41e69d4762937f6ba927059e22abf84801b32
[Ada] Fix missing error on 'Access of constrained array

For X'Access, the designated subtype of the access type must statically
match the nominal subtype of X.  This patch fixes a bug where the error
was not detected when there is an unrelated declaration of the form "Y :
T := X;", where T is an unconstrained array subtype.

gcc/ada/

* exp_util.adb (Expand_Subtype_From_Expr): Generate a new
subtype when Is_Constr_Subt_For_UN_Aliased is True, so the
Is_Constr_Subt_For_U_Nominal flag will not be set on the
preexisting subtype.
* sem_attr.adb, sem_ch3.adb: Minor.
gcc/ada/exp_util.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch3.adb