[Ada] Checks on instantiations with formal derived types with interfaces
authorEd Schonberg <schonberg@adacore.com>
Fri, 25 May 2018 09:03:41 +0000 (09:03 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Fri, 25 May 2018 09:03:41 +0000 (09:03 +0000)
commita036d1de575622d6cc7efb8d1de75ce9c4a27de4
treed5d357f0f77c35119a05b75b2352177283ee37c0
parent1f233db3745890d8c9bed07f44a8b078bb2a0ee9
[Ada] Checks on instantiations with formal derived types with interfaces

This patch implements the rule stated in RM 12.5.5 : the actual shall be
a descendant of very progenitor of the formal type.

2018-05-25  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch12.adb (Validate_Derived_Type_Instance): Verify that the actual
for a formal derived type implements all the interfaces declared for
the formal.

gcc/testsuite/

* gnat.dg/interface6.adb: New testcase.

From-SVN: r260723
gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/interface6.adb [new file with mode: 0644]