[Ada] Membership test of class-wide interface
authorJavier Miranda <miranda@adacore.com>
Fri, 25 May 2018 09:05:04 +0000 (09:05 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Fri, 25 May 2018 09:05:04 +0000 (09:05 +0000)
commit25409c3c63b151f27bd77fb92c8b62af8681d777
treed26a019e5cfaf745e6caebd74e8f607218e03454
parent1f6237e3ddfba881d87d9c62d0b806717a71fbe5
[Ada] Membership test of class-wide interface

The compiler rejects the use of a membership test when the left operand
is a class-wide interface type object and the right operand is not a
class-wide type.

2018-05-25  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* sem_res.adb (Resolve_Membership_Op): Allow the use of the membership
test when the left operand is a class-wide interface and the right
operand is not a class-wide type.
* exp_ch4.adb (Tagged_Membership): Adding support for interface as the
left operand.

gcc/testsuite/

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

From-SVN: r260738
gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/sem_res.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/interface7.adb [new file with mode: 0644]