public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Do not mention an error on continuation message of info message
@ 2017-04-25 10:49 Arnaud Charlet
  0 siblings, 0 replies; only message in thread
From: Arnaud Charlet @ 2017-04-25 10:49 UTC (permalink / raw)
  To: gcc-patches; +Cc: Yannick Moy

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

Info messages are used in GNATprove to inform the user of subtleties in
how source constructs are verified. They should not be mistaken for
error messages in continuation messages. Now fixed.

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

2017-04-25  Yannick Moy  <moy@adacore.com>

	* errout.adb (Error_Msg): Adapt continuation
	message in instantiations and inlined bodies for info messages.


[-- Attachment #2: difs --]
[-- Type: text/plain, Size: 2353 bytes --]

Index: errout.adb
===================================================================
--- errout.adb	(revision 247177)
+++ errout.adb	(working copy)
@@ -423,9 +423,14 @@
 
       --  or
 
-      --     warning: in instantiation at
+      --     warning: in instantiation at ...
       --     warning: original warning message
 
+      --  or
+
+      --     info: in instantiation at ...
+      --     info: original info message
+
       --  All these messages are posted at the location of the top level
       --  instantiation. If there are nested instantiations, then the
       --  instantiation error message can be repeated, pointing to each
@@ -440,9 +445,14 @@
 
       --  or
 
-      --     warning: in inlined body at
+      --     warning: in inlined body at ...
       --     warning: original warning message
 
+      --  or
+
+      --     info: in inlined body at ...
+      --     info: original info message
+
       --  OK, here we have an instantiation error, and we need to generate the
       --  error on the instantiation, rather than on the template.
 
@@ -494,8 +504,12 @@
                --  Case of inlined body
 
                if Inlined_Body (X) then
-                  if Is_Warning_Msg or Is_Style_Msg then
+                  if Is_Info_Msg then
                      Error_Msg_Internal
+                       ("info: in inlined body #",
+                        Actual_Error_Loc, Flag_Location, Msg_Cont_Status);
+                  elsif Is_Warning_Msg or Is_Style_Msg then
+                     Error_Msg_Internal
                        (Warn_Insertion & "in inlined body #",
                         Actual_Error_Loc, Flag_Location, Msg_Cont_Status);
                   else
@@ -507,8 +521,12 @@
                --  Case of generic instantiation
 
                else
-                  if Is_Warning_Msg or else Is_Style_Msg then
+                  if Is_Info_Msg then
                      Error_Msg_Internal
+                       ("info: in instantiation #",
+                        Actual_Error_Loc, Flag_Location, Msg_Cont_Status);
+                  elsif Is_Warning_Msg or else Is_Style_Msg then
+                     Error_Msg_Internal
                        (Warn_Insertion & "in instantiation #",
                         Actual_Error_Loc, Flag_Location, Msg_Cont_Status);
                   else

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

only message in thread, other threads:[~2017-04-25 10:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 10:49 [Ada] Do not mention an error on continuation message of info message Arnaud Charlet

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).