]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix spurious warning on unreferenced internal generic instance
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 27 Jun 2022 11:09:10 +0000 (13:09 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 12 Jul 2022 12:24:12 +0000 (12:24 +0000)
This patch removes a spurious warning, saying that an internal entity of
a generic formal package is unreferenced. The immediate cause of this
warning is that the internal entity is explicitly flagged as coming from
source.

The explicit flagging was added decades ago to fix a missing
cross-reference in the ALI file. Apparently these days the
cross-references work fine without this flag.

gcc/ada/

* sem_ch12.adb (Analyze_Package_Instantiation): Remove dubious
call to Set_Comes_From_Source.

gcc/ada/sem_ch12.adb

index af8bbbe2f9ea17d65508e6b8134476a07435a7cb..c980d7bb0ce632812987359055bea6c00279ab2f 100644 (file)
@@ -4297,7 +4297,6 @@ package body Sem_Ch12 is
 
       if Nkind (N) = N_Package_Instantiation then
          Act_Decl_Id := New_Copy (Defining_Entity (N));
-         Set_Comes_From_Source (Act_Decl_Id, True);
 
          if Nkind (Defining_Unit_Name (N)) = N_Defining_Program_Unit_Name then
             Act_Decl_Name :=