[Ada] Wrong evaluation of membership test
authorJavier Miranda <miranda@adacore.com>
Mon, 8 Jul 2019 08:14:32 +0000 (08:14 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 8 Jul 2019 08:14:32 +0000 (08:14 +0000)
commitfa2538c77b94a62c657aee31a613ea29e6a46d4d
tree78e0143b58e8943d97f6c4a1f33431c0f26fad67
parent570d5bbc7b7c5f7eb0eb03660a93687a6698ae7e
[Ada] Wrong evaluation of membership test

The code generated by the compiler erroneously evaluates to True
membership tests when their left operand is a a class-wide interface
object and the right operand is a tagged type that implements such
interface type.

2019-07-08  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_ch4.adb (Tagged_Membership): Fix regression silently
introduced in r260738 that erroneouslusy causes the evaluation
to True of the membership test when the left operand of the
membership test is a class-wide interface object and the right
operand is a type that implements such interface type.

gcc/testsuite/

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

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