]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Escalate pre-continuation messages from warnings to errors
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 8 Dec 2021 21:58:22 +0000 (22:58 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 11 Jan 2022 13:24:45 +0000 (13:24 +0000)
gcc/ada/

* errout.adb (Error_Msg_Internal): Propagate warnings-as-error
flag from continuation message to its preceding messages.

gcc/ada/errout.adb

index 00230a25fd7ee1876050f4c2aca578218bbe6aad..0778f54944d2a15a99282918585174b36058b11d 100644 (file)
@@ -1240,10 +1240,13 @@ package body Errout is
                       or else
                     Warning_Treated_As_Error (Get_Warning_Tag (Cur_Msg)));
 
-      --  Propagate Warn_Err to this message and preceding continuations
+      --  Propagate Warn_Err to this message and preceding continuations.
+      --  Likewise, propagate Is_Warning_Msg, because the current continued
+      --  message could have been escalated from warning to error.
 
       for J in reverse 1 .. Errors.Last loop
          Errors.Table (J).Warn_Err := Warn_Err;
+         Errors.Table (J).Warn     := Is_Warning_Msg;
          exit when not Errors.Table (J).Msg_Cont;
       end loop;