ada: Spurious error analyzing 'old or 'result in class-wide conditions
commit072861beb9bcc6cbf2e16aafe6b0aae049d60989
authorJavier Miranda <miranda@adacore.com>
Thu, 26 Jan 2023 19:39:31 +0000 (26 19:39 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 16 May 2023 08:30:58 +0000 (16 10:30 +0200)
treec99c7a17fabf6cc49fbbadc192cbdc9dc132dd39
parentb979a474167624bf658fd30a23e99f087d7c6e0a
ada: Spurious error analyzing 'old or 'result in class-wide conditions

gcc/ada/

* sem_attr.adb
(Analyze_Attribute_Old_Result): When preanalyzing a class-wide
condition, search in the scopes stack for the subprogram that has
the condition. This is required because returning the current
scope causes reporting spurious errors when the occurrence of the
attribute is found, for example, in a quantified expression.
gcc/ada/sem_attr.adb