ada: Spurious error on Lock_Free protected type with discriminants
commitaf94026524eafbe1270e28e5142e5958a4dadf07
authorJustin Squirek <squirek@adacore.com>
Wed, 23 Nov 2022 07:56:45 +0000 (23 07:56 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 24 Nov 2022 10:11:25 +0000 (24 11:11 +0100)
tree2c55cd027b0bbd4ca8173daa9baaf17cd281ba92
parenta42e39a7b974645d2820931357e99411fdb0beb6
ada: Spurious error on Lock_Free protected type with discriminants

This patch corrects an issue in the compiler whereby unprefixed discriminants
appearing in protected subprograms were unable to be properly resolved -
leading to spurious resolution errors.

gcc/ada/

* sem_ch8.adb
(Find_Direct_Name): Remove bypass to reanalyze incorrectly
analyzed discriminals.
(Set_Entity_Or_Discriminal): Avoid resetting the entity field of a
discriminant reference to be the internally generated renaming
when we are in strict preanalysis mode.
gcc/ada/sem_ch8.adb