[Ada] Fix assertion failure on derived private protected type
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 21 Aug 2019 08:29:42 +0000 (08:29 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 21 Aug 2019 08:29:42 +0000 (08:29 +0000)
commit78170c8ea108d76c9ed44b9a59546aadf64e9c3e
treef25d401dba115fe9f6b26cabfeeb69200890ed7b
parent5188952e59475e3744c88aba9d9e8b07c8364987
[Ada] Fix assertion failure on derived private protected type

This fixes an assertion failure on the instantiation of a generic
package on a type derived from the private view of a protected type,
ultimately caused by Finalize_Address returning Empty for the subtype
built for the generic actual type of the instantiation.

Finalize_Address has a special processing for untagged derivations of
private views, but it would no longer trigger for the subtype because
this subtype is now represented as a subtype of an implicit derived base
type instead of as the derived type of an implicit subtype previously.

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

gcc/ada/

* exp_util.adb (Finalize_Address): Deal consistently with
subtypes of private protected types.

gcc/testsuite/

* gnat.dg/prot9.adb, gnat.dg/prot9_gen.ads,
gnat.dg/prot9_pkg1.ads, gnat.dg/prot9_pkg2.ads: New testcase.

From-SVN: r274778
gcc/ada/ChangeLog
gcc/ada/exp_util.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/prot9.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/prot9_gen.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/prot9_pkg1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/prot9_pkg2.ads [new file with mode: 0644]