From: Yannick Moy Date: Thu, 13 Jan 2022 16:35:24 +0000 (+0100) Subject: [Ada] Set Error_Msg_Warn before use of << insertion X-Git-Tag: basepoints/gcc-14~7017 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=706940c2c867bc2609338f27eaea056aedc13d63;p=thirdparty%2Fgcc.git [Ada] Set Error_Msg_Warn before use of << insertion 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. --- diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 09e734defb2..9de384a4eb9 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -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);