public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Fix inconsistent parameter of SPARK_Msg_NE
@ 2020-11-24 10:17 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2020-11-24 10:17 UTC (permalink / raw)
  To: gcc-patches; +Cc: Piotr Trojanek

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

All calls to SPARK_Msg_NE except one were taking an entity as its second
parameter; this patch does the same for one call that took an
identifier.

Code cleanup only; behaviour is unaffected, because both entity and
identifier works in the same when given to SPARK_Msg_NE routine.

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

gcc/ada/

	* sem_prag.adb (Analyze_Global_Item): Call SPARK_Msg_NE with the
	entity, not with its identifier.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 461 bytes --]

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -2385,7 +2385,7 @@ package body Sem_Prag is
 
                   if Ekind (Item_Id) in Named_Kind then
                      SPARK_Msg_NE
-                       ("\named number & is not an object", Item, Item);
+                       ("\named number & is not an object", Item, Item_Id);
                   end if;
 
                   return;



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-24 10:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 10:17 [Ada] Fix inconsistent parameter of SPARK_Msg_NE 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).