[Ada] Crash on instantiation of nested generic in private part

Programming / Compilers / GCC - pmderodat [138bc75d-0d04-0410-961f-82ee72b054a4] - 11 June 2018 09:16 EDT

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

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.

fbe3e1a7a3d [Ada] Crash on instantiation of nested generic in private part
gcc/ada/ChangeLog | 8 ++++++++
gcc/ada/sem_ch12.adb | 8 ++++++--
gcc/testsuite/ChangeLog | 6 ++++++
gcc/testsuite/gnat.dg/nested_generic2.adb | 5 +++++
gcc/testsuite/gnat.dg/nested_generic2.ads | 13 +++++++++++++
gcc/testsuite/gnat.dg/nested_generic2_g1.adb | 15 +++++++++++++++
gcc/testsuite/gnat.dg/nested_generic2_g1.ads | 13 +++++++++++++
gcc/testsuite/gnat.dg/nested_generic2_g2.ads | 7 +++++++
8 files changed, 73 insertions(+), 2 deletions(-)

Upstream: gcc.gnu.org


  • Share