[Ada] Crash on compilation unit function that builds in place
authorEd Schonberg <schonberg@adacore.com>
Tue, 11 Dec 2018 11:11:00 +0000 (11:11 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 11 Dec 2018 11:11:00 +0000 (11:11 +0000)
commit5e366628853651e5d7a98e7bc12f5fb7746ce993
tree4ac1f440ff6cb94ae1ee87f2653e8177773edad1
parent6b6a0f02ab7012daebd62726066b827fbdfa62f9
[Ada] Crash on compilation unit function that builds in place

This patch fixes a crash on a function that builds its limited result in
place. Previously this was handled properly only if the function was a
child unit.

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

gcc/ada/

* sem_ch3.adb (Build_Itype_Reference): Handle properly an itype
reference created for a function that is a compilation unit, for
example if the function builds in place an object of a limited
type.

gcc/testsuite/

* gnat.dg/bip_cu.adb, gnat.dg/bip_cu_constructor.adb,
gnat.dg/bip_cu_constructor.ads, gnat.dg/bip_cu_t.adb,
gnat.dg/bip_cu_t.ads: New testcase.

From-SVN: r266999
gcc/ada/ChangeLog
gcc/ada/sem_ch3.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/bip_cu.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/bip_cu_constructor.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/bip_cu_constructor.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/bip_cu_t.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/bip_cu_t.ads [new file with mode: 0644]