[Ada] Fix detection of overlapping actuals with renamings

Pierre-Marie de Rodat derodat@adacore.com
Fri Jun 18 08:38:27 GMT 2021


Routine Denotes_Same_Object wrongly handled renamings of renamings. In a
code like this:

   B : Integer renames A;
   C : Integer renames B;

names "B" and "C" differ and their renamed object names "A" and "B"
differ too. This patch rewrites this routine to literally follow the RM,
which fixes the problem with renamings.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_util.adb (Denotes_Same_Object): Explicitly test for node
	kinds being the same; deal with renamings one-by-one; adjust
	numbers in references to the Ada RM.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 7381 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210618/5c0edee8/attachment.bin>


More information about the Gcc-patches mailing list