[Ada] Fix spurious visibility error for tagged type with inlining
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 22 Jul 2019 13:57:37 +0000 (13:57 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 22 Jul 2019 13:57:37 +0000 (13:57 +0000)
commit116992570783944a12e64e63db9f5a2445e10016
treeaa4626c07b776c514f379053f983b825910d797f
parentff9d220ede29dc7d0d40933733180f12cba54f17
[Ada] Fix spurious visibility error for tagged type with inlining

This fixes a spurious visibility error for the very peculiar case where
an operator that operates on the class-wide type of a tagged type is
declared in a package, the operator is renamed in another package where
a subtype of the tagged type is declared, and both packages end up in
the transititive closure of a unit compiled with optimization and
inter-inlining (-gnatn).

2019-07-22  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

* sem_ch8.adb (End_Use_Type): Reset the In_Use flag on the
class-wide type if the type is tagged.
(Use_One_Type): Add commentary on the handling of the class-wide
type.

gcc/testsuite/

* gnat.dg/inline17.adb, gnat.dg/inline17_pkg1.adb,
gnat.dg/inline17_pkg1.ads, gnat.dg/inline17_pkg2.ads,
gnat.dg/inline17_pkg3.adb, gnat.dg/inline17_pkg3.ads: New
testcase.

From-SVN: r273683
gcc/ada/ChangeLog
gcc/ada/sem_ch8.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/inline17.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/inline17_pkg1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/inline17_pkg1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/inline17_pkg2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/inline17_pkg3.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/inline17_pkg3.ads [new file with mode: 0644]