[Ada] Spurious error on predicate of subtype in generic
authorEd Schonberg <schonberg@adacore.com>
Wed, 3 Jul 2019 08:13:41 +0000 (08:13 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 3 Jul 2019 08:13:41 +0000 (08:13 +0000)
commitf51e316c7c7d0b2aad8b8444253369f2e819aee5
tree3191fdef35b109604d0e104514166bfd0e0bf582
parent07ec36eed91154bd164081aed2dcb59d05910dc7
[Ada] Spurious error on predicate of subtype in generic

This patch fixes a spurious error on a dynamic predicate of a record
subtype when the expression for the predicate includes a selected
component that denotes a component of the subtype.

2019-07-03  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch8.adb (Find_Selected_Component): If the prefix is the
current instance of a type or subtype, complete the resolution
of the name by finding the component of the type denoted by the
selector name.

gcc/testsuite/

* gnat.dg/predicate4.adb, gnat.dg/predicate4_pkg.ads: New
testcase.

From-SVN: r272961
gcc/ada/ChangeLog
gcc/ada/sem_ch8.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/predicate4.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate4_pkg.ads [new file with mode: 0644]