[Ada] Strengthen checks for instantiation with interface types
commit41610f15111a8d1beda58a932e8469299ba7e486
authorEd Schonberg <schonberg@adacore.com>
Fri, 25 May 2018 09:03:59 +0000 (25 09:03 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Fri, 25 May 2018 09:03:59 +0000 (25 09:03 +0000)
tree7a9da9455d51fcacb39528c7ef055c95b31b94de
parent9da8032d4b0b5ca8cf5397b617cbcef55f735e19
[Ada] Strengthen checks for instantiation with interface types

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

gcc/ada/

* sem_ch12.adb (Instance_Exists): New function, subsidiary of
Validate_Derived_Type_Instance, to verify that all interfaces
implemented by the formal type are also implemented by the actual. The
verification is complicated when an interface of the formal is declared
in a generic unit and the actual is declared in an instance of it.
There is currently no mechanism to relate an interface declared within
a generic to the corresponding interface in an instance, so we must
traverse the list of interfaces of the actual, looking for a name
match, and verifying that that interface is declared in an instance.

From-SVN: r260726
gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb