* [Ada] Fix spurious warning on unreferenced internal generic instance
@ 2022-07-12 12:25 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-07-12 12:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Piotr Trojanek
[-- Attachment #1: Type: text/plain, Size: 548 bytes --]
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.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_ch12.adb (Analyze_Package_Instantiation): Remove dubious
call to Set_Comes_From_Source.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 435 bytes --]
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -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 :=
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-12 12:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 12:25 [Ada] Fix spurious warning on unreferenced internal generic instance Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).