]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Compiler crash on decl. with limited aggregate and address clause
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Nov 2018 11:41:41 +0000 (11:41 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Nov 2018 11:41:41 +0000 (11:41 +0000)
commit5bb7054697b577f6a23be31fbce376834680739b
tree515b8747f3b83e3566374bc214d9b0fdcea2458e
parent2c0ae288dc340df801675479651504e7f94b0add
[Ada] Compiler crash on decl. with limited aggregate and address clause

This patch fixes a compiler abort on an object declaration whose
expression is an aggregate, when the type of the object is limited and
the declaration is followed by an address clause for the declared
object.

2018-11-14  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch3.adb: (Expand_N_Object_Declaration): If the expression
is a limited aggregate its resolution is delayed until the
object declaration is expanded.
* sem_ch3.adb: (Analyze_Object_Declaration): If the expression
is a limited aggregate and the declaration has a following
address clause indicate that resolution of the aggregate (which
must be built in place) must be delayed.

gcc/testsuite/

* gnat.dg/limited_aggr.adb, gnat.dg/limited_aggr.ads: New
testcase.

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