[Ada] Crash on protected type with self-referential component
authorEd Schonberg <schonberg@adacore.com>
Thu, 11 Jul 2019 08:02:53 +0000 (08:02 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 11 Jul 2019 08:02:53 +0000 (08:02 +0000)
commita13a714e710f13b6fa6f88481a3c94b7d2dbc8cf
treeae2a85f3c9039b8718d0be7b8a2ebcb14bd3d650
parent810097a72d1767627d2439bb94627b443f41bf7f
[Ada] Crash on protected type with self-referential component

This patch fixes a compiler abort on a declarastion for a protected type
PT when one of its private component is of type access PT.

2019-07-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* exp_ch9.adb (Expand_N_Protected_Type_Declaaration): New
subsidiary routine Replace_Access_Definition, to handle properly
a protected type PT one of whose private components is of type
access PT.

gcc/testsuite/

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

From-SVN: r273399
gcc/ada/ChangeLog
gcc/ada/exp_ch9.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/prot8.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/prot8.ads [new file with mode: 0644]