[gcc r11-1088] [Ada] Spurious error on instantiations with Taft_Amendment types and tasks

Pierre-Marie de Rodat pmderodat@gcc.gnu.org
Tue Jun 9 08:10:20 GMT 2020


https://gcc.gnu.org/g:54025948c0a4cad05cc22fe67d104e5e3ac9b0de

commit r11-1088-g54025948c0a4cad05cc22fe67d104e5e3ac9b0de
Author: Ed Schonberg <schonberg@adacore.com>
Date:   Mon Feb 24 13:37:58 2020 -0500

    [Ada] Spurious error on instantiations with Taft_Amendment types and tasks
    
    2020-06-09  Ed Schonberg  <schonberg@adacore.com>
    
    gcc/ada/
    
            * exp_ch9.adb (Build_Master_Renaming): Make name in renaming
            declaration unique by adding a numeric suffix, to prevent
            accidental name conflict when several instantiations of a
            package containing an access_to_incomplete type that designate
            tasks appear in the same scope.

Diff:
---
 gcc/ada/exp_ch9.adb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 36baf6f74e5..2efa6d1b21f 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -3469,10 +3469,13 @@ package body Exp_Ch9 is
 
       --  Generate:
       --    <Ptr_Typ>M : Master_Id renames _Master;
+      --  and add a numeric suffix to the name to ensure that it is
+      --  unique in case other access types in nested constructs
+      --  are homonyms of this one.
 
       Master_Id :=
         Make_Defining_Identifier (Loc,
-          New_External_Name (Chars (Ptr_Typ), 'M'));
+          New_External_Name (Chars (Ptr_Typ), 'M', -1));
 
       Master_Decl :=
         Make_Object_Renaming_Declaration (Loc,


More information about the Gcc-cvs mailing list