]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Crash on a Storage_Size aspect depending on attr. of another type
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:50:38 +0000 (09:50 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Aug 2019 09:50:38 +0000 (09:50 +0000)
commitbedde605bb8d4dd0cdc699d2f419a52f0f1d7d8c
tree49420f5a0fdab1e7dd0035516762c89709a8023a
parent5c492d3cef3306fe70d60ddd735cfeaede3b69a2
[Ada] Crash on a Storage_Size aspect depending on attr. of another type

This patch fixes a crash on an aspect specification for Storage_Size for
a type T when the expression for the aspect depends on attributes of a
previously declared type that is not frozen yet. The  temporary
declaration that captures the value of the aspect must be part of the
actions attached to the freeze node for T.

2019-08-20  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case
Storage_Size): If the expression for Storage_Size is not static
it may depend on characterstics of another type that may bot be
frozen yet, so the elaboration of the expression for the aspect
must be attached directly to the freeze actions of the type to
which it applies.

gcc/testsuite/

* gnat.dg/storage_size1.adb: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274742 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/exp_ch13.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/storage_size1.adb [new file with mode: 0644]