diff options
author | Viljar Indus <indus@adacore.com> | 2024-08-14 15:24:10 +0300 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-08-29 15:06:27 +0200 |
commit | 4825bbfebc3584765bb9e17c925a81f1853e1a75 (patch) | |
tree | e69964d6ed5bed61de6e6370a8d18e4d43c82d4d /gcc | |
parent | f872bba253c0edf55436c77f8d3edd881e7bdaba (diff) | |
download | gcc-4825bbfebc3584765bb9e17c925a81f1853e1a75.zip gcc-4825bbfebc3584765bb9e17c925a81f1853e1a75.tar.gz gcc-4825bbfebc3584765bb9e17c925a81f1853e1a75.tar.bz2 |
ada: Avoid creating continuation messages without an intended parent
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_ch6.adb | 12 | ||||
-rw-r--r-- | 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 686aa32..b406cfc 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 a55ba3c..5cea155 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 461bdfc..86d7845 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 556a0b7..388b009 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); |