https://gcc.gnu.org/g:c9aeb782c7899c616ed122a68119b12c04e3c82c

commit r16-5476-gc9aeb782c7899c616ed122a68119b12c04e3c82c
Author: Viljar Indus <[email protected]>
Date:   Tue Nov 11 14:57:34 2025 +0200

    ada: Avoid non-serious errors masking fatal errors
    
    Is_Redundant_Error_Message is used to filter diagnostic messages
    that would appear on the same line to avoid the noise comming from
    cascading error messages. However we still want to trigger an error
    even if the line already had a warning or a non-serious error at the
    same location so that we now that a fatal error has occured and the
    compiler knows how to exit correctly in that scenario.
    
    gcc/ada/ChangeLog:
    
            * erroutc.adb (Is_Redundant_Error_Message): Avoid non-serious errors
            masking fatal errors.

Diff:
---
 gcc/ada/erroutc.adb | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
index bbbe245cefde..bbc41c733dc2 100644
--- a/gcc/ada/erroutc.adb
+++ b/gcc/ada/erroutc.adb
@@ -461,15 +461,16 @@ package body Erroutc is
 
         and then not Errors.Table (Cur_Msg).Msg_Cont
 
-        --  Don't delete if prev msg is warning and new msg is an error.
-        --  This is because we don't want a real error masked by a
-        --  warning. In all other cases (that is parse errors for the
-        --  same line that are not unconditional) we do delete the
-        --  message. This helps to avoid junk extra messages from
-        --  cascaded parsing errors
-
-        and then (Errors.Table (Prev_Msg).Kind not in Warning | Style
-                  or else Errors.Table (Cur_Msg).Kind in Warning | Style);
+        --  Don't delete if prev msg is warning or a non-serious-error and new
+        --  msg is an error. This is because we don't want a real error masked
+        --  by a warning. In all other cases (that is parse errors for the same
+        --  line that are not unconditional) we do delete the message. This
+        --  helps to avoid junk extra messages from cascaded parsing errors.
+
+        and then (Errors.Table (Prev_Msg).Kind
+                  not in Warning | Style | Non_Serious_Error
+                  or else Errors.Table (Cur_Msg).Kind
+                          in Warning | Style | Non_Serious_Error);
    end Is_Redundant_Error_Message;
 
    --------------------

Reply via email to