From 879e92d0575d29dd6f5de7757c3c0bbc9fb80079 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 8 Nov 2017 13:52:43 +0000 Subject: [PATCH] sem_util.adb (Subprogram_Name): Append suffix for overloaded subprograms. 2017-11-08 Arnaud Charlet * sem_util.adb (Subprogram_Name): Append suffix for overloaded subprograms. From-SVN: r254529 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/sem_util.adb | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 912de2376dc..528988f8ef5 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2017-11-08 Arnaud Charlet + + * sem_util.adb (Subprogram_Name): Append suffix for overloaded + subprograms. + 2017-11-08 Yannick Moy * sem_ch8.adb (Use_One_Type, Update_Use_Clause_Chain): Do not report diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 79c88648fc2..9d55b0a2237 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -23357,6 +23357,28 @@ package body Sem_Util is Append_Entity_Name (Buf, Ent); + -- Append homonym number if needed + + if Nkind (N) in N_Entity and then Has_Homonym (N) then + declare + H : Entity_Id := Homonym (N); + Nr : Nat := 1; + begin + while Present (H) loop + if Scope (H) = Scope (N) then + Nr := Nr + 1; + end if; + + H := Homonym (H); + end loop; + + if Nr > 1 then + Append (Buf, '#'); + Append (Buf, Nr); + end if; + end; + end if; + -- Append source location of Ent to Buf so that the string will -- look like "subp:file:line:col". -- 2.30.2