[Ada] Fix spurious visibility error for tagged type with inlining

Pierre-Marie de Rodat derodat@adacore.com
Mon Jul 22 14:16:00 GMT 2019


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).

Tested on x86_64-pc-linux-gnu, committed on trunk

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 3122 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190722/d6d381e4/attachment.bin>


More information about the Gcc-patches mailing list