[Ada] Spurious error on overloaded equality in postcondition
authorEd Schonberg <schonberg@adacore.com>
Wed, 10 Jul 2019 08:59:55 +0000 (08:59 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 10 Jul 2019 08:59:55 +0000 (08:59 +0000)
commitff3ee5e5ef8c91d94a0ff6236a46dc46a670f1c3
tree54e1002b0622f74c880643bbeb9cd87b78864ade
parent19448640ac04e980ef665ae72bc3f106b4e5b6e0
[Ada] Spurious error on overloaded equality in postcondition

This patch fixes a spurious error in a postcondition in a nested
instantiation when the expression includes an inherited equality and
checks are enabled.

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

gcc/ada/

* sem_res.adb (Resolve_Equality_Op): Do not replace the resolved
operator by its alias if expander is not active, because the
operand type may not be frozen yet and its inherited operations
have not yet been created.

gcc/testsuite/

* gnat.dg/equal8.adb, gnat.dg/equal8.ads,
gnat.dg/equal8_pkg.ads: New testcase.

From-SVN: r273327
gcc/ada/ChangeLog
gcc/ada/sem_res.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/equal8.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/equal8.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/equal8_pkg.ads [new file with mode: 0644]