[Ada] Crash on instantiation of nested generic in private part
commit73dc56ea3dbfabfadbedf32d0a8d332f9d5ad116
authorEd Schonberg <schonberg@adacore.com>
Mon, 11 Jun 2018 09:16:43 +0000 (11 09:16 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 11 Jun 2018 09:16:43 +0000 (11 09:16 +0000)
tree94ad40094e5f727f935673d28ac3c58196b9b9ba
parent4847a76bd2fedb7966b77e595cf27296275c43ba
[Ada] Crash on instantiation of nested generic in private part

This patch fixes a compiler abort on an instantiation of a generic nested
within another instance, when the outer instance is declared in the visible
part of a package and the inner intance is in the private part of the same
package.

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

gcc/ada/

* sem_ch12.adb (Install_Body): In order to determine the placement of
the freeze node for an instance of a generic nested within another
instance, take into account that the outer instance may be declared in
the visible part of a package and the inner intance may be in the
private part of the same package.

gcc/testsuite/

* gnat.dg/nested_generic2.adb, gnat.dg/nested_generic2.ads,
gnat.dg/nested_generic2_g1.adb, gnat.dg/nested_generic2_g1.ads,
gnat.dg/nested_generic2_g2.ads: New testcase.

From-SVN: r261398
gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/nested_generic2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/nested_generic2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/nested_generic2_g1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/nested_generic2_g1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/nested_generic2_g2.ads [new file with mode: 0644]