Warnings about declarations being hidden can be issued in some cases
when compiling a generic instantiation, but such warnings aren't correct
(hiding can be flagged in a generic, but shouldn't be in an instance).
The warning is now suppressed within instances.

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

gcc/ada/

        * sem_util.adb (Enter_Name): Suppress hiding warning when in an
        instance.
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -8656,6 +8656,10 @@ package body Sem_Util is
         and then Comes_From_Source (C)
         and then Comes_From_Source (Def_Id)
 
+        --  Don't warn within a generic instantiation
+
+        and then not In_Instance
+
         --  Don't warn unless entity in question is in extended main source
 
         and then In_Extended_Main_Source_Unit (Def_Id)


Reply via email to