[Ada] Fix internal error on inlined subprogram instance
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 14 Aug 2019 09:51:39 +0000 (09:51 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Aug 2019 09:51:39 +0000 (09:51 +0000)
commit2a127979d92caafe31a2c9be5d9f5bb70e1f4d98
tree5123dc681526f854a38f8fd7859fcf521025e66c
parent16b9e3c32d0c52334644021e5e0465b1c43d190e
[Ada] Fix internal error on inlined subprogram instance

This fixes a long-standing oddity in the procedure analyzing the
instantiation of a generic subprogram, which would set the
Is_Generic_Instance flag on the enclosing package generated for the
instantiation but only to reset it a few lines below.  Now this flag is
relied upon by the machinery which computes the set of public entities
to be exposed by a package.

2019-08-14  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
the Is_Generic_Instance flag previously set on the package
generated for the instantiation of a generic subprogram.

gcc/testsuite/

* gnat.dg/generic_inst11.adb, gnat.dg/generic_inst11_pkg.adb,
gnat.dg/generic_inst11_pkg.ads: New testcase.

From-SVN: r274457
gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/generic_inst11.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/generic_inst11_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/generic_inst11_pkg.ads [new file with mode: 0644]