[Ada] Compiler crash on decl. with limited aggregate and address clause
authorEd Schonberg <schonberg@adacore.com>
Wed, 14 Nov 2018 11:41:41 +0000 (11:41 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Nov 2018 11:41:41 +0000 (11:41 +0000)
commit41a59f6b14660aaf802d749a22d07c14660312ed
tree515b8747f3b83e3566374bc214d9b0fdcea2458e
parent1e3c434fa08b0ee0e4f9b5ce803e282d8832a559
[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.

From-SVN: r266125
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]