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

gcc/ada/ChangeLog:

        * errout.adb (Delete_Warning_And_Continuations): Use
        Decrease_Error_Msg_Count to update the message counts.
        (Delete_Warning): Likewise.
        (To_Be_Removed): Likewise.

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

---
 gcc/ada/errout.adb | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 5ba44a21d21..c1ceaf2815b 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -277,11 +277,7 @@ package body Errout is
          begin
             if not M.Deleted then
                M.Deleted := True;
-               Warnings_Detected := Warnings_Detected - 1;
-
-               if M.Warn_Err then
-                  Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
-               end if;
+               Decrease_Error_Msg_Count (M);
             end if;
 
             Id := M.Next;
@@ -1803,11 +1799,7 @@ package body Errout is
       begin
          if not Errors.Table (E).Deleted then
             Errors.Table (E).Deleted := True;
-            Warnings_Detected := Warnings_Detected - 1;
-
-            if Errors.Table (E).Warn_Err then
-               Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
-            end if;
+            Decrease_Error_Msg_Count (Errors.Table (E));
          end if;
       end Delete_Warning;
 
@@ -3335,11 +3327,7 @@ package body Errout is
 
                and then not Errors.Table (E).Uncond
             then
-               Warnings_Detected := Warnings_Detected - 1;
-
-               if Errors.Table (E).Warn_Err then
-                  Warnings_Treated_As_Errors := Warnings_Treated_As_Errors - 1;
-               end if;
+               Decrease_Error_Msg_Count (Errors.Table (E));
 
                return True;
 
-- 
2.43.0

Reply via email to