From: Viljar Indus <in...@adacore.com>

The messages modified in this patch do not have a clear intended
parent. This causes a lot of issues when grouping continuation
messages together with their parent. This can be confusing as it
is not obvious what was the parent message that caused this
problem or in worst case scenarios the message not being printed
alltogether.

These modified messages do not seem to be related to any concrete
error message and thus should be treated as independent messages.

gcc/ada/

        * sem_ch12.adb (Abandon_Instantiation): Remove continuation
        characters from the error message.
        * sem_ch13.adb (Check_False_Aspect_For_Derived_Type): Remove
        continuation characters from the error message.
        * sem_ch6.adb (Assert_False): Avoid creating a continuation
        message without a parent. If no primary message is created then
        the message is considered as primary.

gcc/testsuite/ChangeLog:

        * gnat.dg/interface6.adb: Adjust test.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch12.adb                 |  2 +-
 gcc/ada/sem_ch13.adb                 |  2 +-
 gcc/ada/sem_ch6.adb                  | 12 +++++++++---
 gcc/testsuite/gnat.dg/interface6.adb |  1 +
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 686aa3208fb..b406cfce3b3 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -2295,7 +2295,7 @@ package body Sem_Ch12 is
 
    procedure Abandon_Instantiation (N : Node_Id) is
    begin
-      Error_Msg_N ("\instantiation abandoned!", N);
+      Error_Msg_N ("instantiation abandoned!", N);
       raise Instantiation_Error;
    end Abandon_Instantiation;
 
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index a55ba3c7bd9..5cea155dc1e 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1247,7 +1247,7 @@ package body Sem_Ch13 is
 
                      if Etype (Expression (ASN)) = Any_Type then
                         Error_Msg_NE
-                          ("\aspect must be fully defined before & is frozen",
+                          ("aspect must be fully defined before & is frozen",
                            ASN, E);
                      end if;
 
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 461bdfcbe4b..86d784543f3 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -7361,6 +7361,8 @@ package body Sem_Ch6 is
                   Error_Msg_N
                     ("implied return after this statement would have raised "
                      & "Program_Error", Last_Stm);
+                  Error_Msg_NE
+                    ("\procedure & is marked as No_Return!", Last_Stm, Proc);
 
                --  In normal compilation mode, do not warn on a generated call
                --  (e.g. in the body of a renaming as completion).
@@ -7369,11 +7371,15 @@ package body Sem_Ch6 is
                   Error_Msg_N
                     ("implied return after this statement will raise "
                      & "Program_Error??", Last_Stm);
+
+                  Error_Msg_NE
+                    ("\procedure & is marked as No_Return??!", Last_Stm, Proc);
+               else
+
+                  Error_Msg_NE
+                    ("procedure & is marked as No_Return!", Last_Stm, Proc);
                end if;
 
-               Error_Msg_Warn := SPARK_Mode /= On;
-               Error_Msg_NE
-                 ("\procedure & is marked as No_Return<<!", Last_Stm, Proc);
             end if;
 
             declare
diff --git a/gcc/testsuite/gnat.dg/interface6.adb 
b/gcc/testsuite/gnat.dg/interface6.adb
index 556a0b73c92..388b0090599 100644
--- a/gcc/testsuite/gnat.dg/interface6.adb
+++ b/gcc/testsuite/gnat.dg/interface6.adb
@@ -36,6 +36,7 @@ procedure Interface6 is
 
      procedure Test_Instance1 is new Test (T => Rec_Type);  --  { dg-error 
"actual must implement all interfaces of formal \"T\"" }
      procedure Test_Instance1 is new Test (T => Rec_Type1);  -- { dg-error 
"actual \"Rec_Type1\" must implement interface \"TI2\"" }
+     -- { dg-error "instantiation abandoned" "" { target *-*-* } 37 }
      procedure Test_Instance2 is new Test (T => Rec_Type2);
      procedure Test_Instance12 is new Test (T => Rec_Type12);
 
-- 
2.45.2

Reply via email to