[Ada] In a generic use Presanalyze_Spec_Expression on Predicates
authorEd Schonberg <schonberg@adacore.com>
Tue, 17 Sep 2019 08:00:07 +0000 (08:00 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 17 Sep 2019 08:00:07 +0000 (08:00 +0000)
commita9a08e6d331cb454741d2b089cdedaefedfd5271
treee16bb4785cb0191756fb6d85af223dc5a7ba4537
parent01e44bfa81a3423d55e5d624e2c7241daedf44e4
[Ada] In a generic use Presanalyze_Spec_Expression on Predicates

When verifying that the meaning of an aspect has not changed between the
freeze point of the entity and the end of the declarations, we analkyze
a copy of the expression to verify its conformance to previous analysis.
If the expression contains overloaded references, these have to be
resolved, which is not done if the expression is only preanalyzed.  This
applies in particular to expressions in predicates.

2019-09-17  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): In a
generic context, for a Predicate aspect, use
Preanalyze_Spec_Expression to verify conformance.

gcc/testsuite/

* gnat.dg/predicate13.adb, gnat.dg/predicate13.ads: New
testcase.

From-SVN: r275778
gcc/ada/ChangeLog
gcc/ada/sem_ch13.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/predicate13.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/predicate13.ads [new file with mode: 0644]