public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-190] [Ada] Set Error_Msg_Warn before use of << insertion
Date: Mon,  9 May 2022 09:31:35 +0000 (GMT)	[thread overview]
Message-ID: <20220509093135.534D8385736A@sourceware.org> (raw)

https://gcc.gnu.org/g:706940c2c867bc2609338f27eaea056aedc13d63

commit r13-190-g706940c2c867bc2609338f27eaea056aedc13d63
Author: Yannick Moy <moy@adacore.com>
Date:   Thu Jan 13 17:35:24 2022 +0100

    [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:
---
 gcc/ada/exp_ch4.adb | 1 +
 1 file changed, 1 insertion(+)

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);


                 reply	other threads:[~2022-05-09  9:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220509093135.534D8385736A@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).