]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Set Error_Msg_Warn before use of << insertion
authorYannick Moy <moy@adacore.com>
Thu, 13 Jan 2022 16:35:24 +0000 (17:35 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 9 May 2022 09:27:34 +0000 (09:27 +0000)
Calls to Error_Msg procedures with a message using the < or <<
insertions need to set appropriately Error_Msg_Warn. This was not done
in one call, which would lead to spurious errors when changing the
implementation of a runtime unit. This fixes it so that changes can be
applied.

gcc/ada/

* exp_ch4.adb (Expand_Allocator_Expression): Set Error_Msg_Warn
correctly.

gcc/ada/exp_ch4.adb

index 09e734defb29af603fe97470ff761696a3246240..9de384a4eb94693a438a8961aba7dabdd4c0d76f 100644 (file)
@@ -835,6 +835,7 @@ package body Exp_Ch4 is
               Make_Raise_Program_Error (Loc,
                 Reason => PE_Accessibility_Check_Failed));
 
+            Error_Msg_Warn := SPARK_Mode /= On;
             Error_Msg_N ("anonymous access discriminant is too deep for use"
                          & " in allocator<<", N);
             Error_Msg_N ("\Program_Error [<<", N);