]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Name resolution in expanded instances
authorSteve Baird <baird@adacore.com>
Fri, 3 Nov 2023 23:00:20 +0000 (16:00 -0700)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 30 Nov 2023 10:12:47 +0000 (11:12 +0100)
commitcff5ecd412493784d88a963da248ca9a1b0a9f64
treefb3ca3e5de81bb2c10ded19c1fc8014bb0bdbbf1
parent769e5925f6a076436981ba64335979b19106f828
ada: Name resolution in expanded instances

In building the tree for an instance of a generic, expansion sets
entity fields on names that refer to things declared outside of the
instance, but leaves the entity field unset on names that should end
up referring to things declared within the instance. These will instead be
set by analysis - the idea is that if a name resolves a certain way in the
generic, then we should get corresponding results if we resolve the
corresponding name in an instance. For this to work, we have to prevent
unrelated declarations that happen to be visible at the point of the
instantiation from participating in resolution. Add code to filter out such
unwanted name resolution candidates.

gcc/ada/

* sem_ch8.adb (Find_Direct_Name): In the case of a resolving a
name that occurs within an instantiation, add code to detect and
filter out unwanted candidate resolutions. The filtering is
performed via a call to Remove_Interp.
gcc/ada/sem_ch8.adb